[CSS/HTML] List menu achtergrond

Pagina: 1
Acties:
  • 150 views

Acties:
  • 0 Henk 'm!

  • ViNyL
  • Registratie: Augustus 2001
  • Niet online
Ik ben bezig met een list menu. Ik wil bij een active item een pijltje plaatsen. Dit kan zowel bij een parent, maar ook bij een child.

Het list menu bij ik op met een un-ordered list.

Hiervoor heb ik 2 classes gemaakt: current en subcurrent. current als een parent aangeklikt is, en subcurrent als een child aangeklikt wordt.

Een probleem waar ik tegen aan loop is dat bij het plaatsen van de current class bij een parent de achtergrond ook bij de child items verschijnt, terwijl repeat op 'no repeat' staat in mijn stylesheet. Blijkbaar wordt de class dus ook op mijn subitems te gepast.
Als ik het zelfde doe bij een subitem met de class 'subcurrent' dan heb ik dat probleem niet.

Hier is de 'current' class toegepast op de parent:
Afbeeldingslocatie: http://wijmakenwebsites.nl/active.png

Hier is de 'subcurrent' class toegepast op een child:
Afbeeldingslocatie: http://wijmakenwebsites.nl/subactive.png

Dit is mijn css:
Cascading Stylesheet:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
    #navigatie {
        font-family:Georgia, "Times New Roman", Times, serif;
        letter-spacing: 0px;
        font-size: 13px;
        width: 270px;
        float: left;
        margin-left: 30px;
        margin-top: 20px;
    }
    
    #navigatie ul {
        list-style:none;
        margin:0;
        padding:0;
        border: none;
        border-bottom: solid 1px #787a79;
    }
    
    #navigatie li {
        border-top: solid 1px #787a79;
    }
    
    #navigatie li a {
        display: block;
        padding: 10px 5px 10px 0.5em;
        text-decoration: none;
        width: 100%;
        color: #000;
    }
    
    #navigatie li a:hover {
        color: #733d4a;
        font-weight: 500;
    }
    
    #navigatie li.current a {
        background-image: url(arrow.gif);
        background-position:right;
        background-repeat:no-repeat;
    }
    
    
    #navigatie li ul {
        border-bottom: none;
        list-style-image:url(images/bullet.gif);
        color: #666867;
        margin-left: 35px;
    }
    
    #navigatie li li {
        border-top: none;
    }
    
    #navigatie li li a {
        display: block;
        padding: 0px 5px 10px 7px;
        text-decoration: none;
        width: 100%;
        color: #000;
        font-size: 12px;        
    }
    
    #navigatie li li.subcurrent a {
        background-image: url(images/arrow-sub.gif);
        background-position:right;
        background-repeat:no-repeat;
    }


Dit is de HTML van het menu:
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<div id="navigatie">
<ul>

<li class="current"><a href="">ACTIVITEITEN</a>
        <ul>
        <li><a href="">SUBITEM 1</a></li>
        <li><a href="">SUBITEM 2</a></li>
       </ul>
</li>
<li><a href="">VERGUNNINGEN MANAGEMENT</a></li>
<li><a href="">RUIMTELIJKE ORDENING</a></li>
<li><a href="">MILIEUONDERZOEKEN</a></li>
<li><a href="">PROJECTLEIDING & MANAGEMENT</a></li>
<li><a href="">ADVIES</a></li>
</ul>
</div>


Zie ik iets over het hoofd?

Acties:
  • 0 Henk 'm!

  • MueR
  • Registratie: Januari 2004
  • Laatst online: 13:47

MueR

Admin Tweakers Discord

is niet lief

Cascading Stylesheet:
1
#navigatie li li a { background:none; }


De nasi is ook in de aanbieding deze week. Geen dank verder.

[ Voor 11% gewijzigd door MueR op 19-03-2010 16:29 ]

Anyone who gets in between me and my morning coffee should be insecure.


Dit topic is gesloten.