ik ben een beginner met css. Tot nu gaat alles goed, maar krijg toch een probleempje.
Ik heb een rollover menu.
Daarvan wil ik dat als je op de geselecteerde pagina komt. De a:hover status active blijft.
Nu wil ik dit gewoon handmatig op elke pagina veranderd, omdat het toch maar een kleine site is.
Maar krijg het maar niet voor elkaar.
mijn css menu:
html:
blijkbaar kan je bij een list niet een class laten overrulen?
Ik heb een rollover menu.
Daarvan wil ik dat als je op de geselecteerde pagina komt. De a:hover status active blijft.
Nu wil ik dit gewoon handmatig op elke pagina veranderd, omdat het toch maar een kleine site is.
Maar krijg het maar niet voor elkaar.
mijn css menu:
code:
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
| #navigation {
font-family: verdana, Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight: normal;
letter-spacing:6px;
width: 304px;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
padding: 0;
background-color: #135894;
color: #fff;
height:100%;
text-align:left;
}
#navigation ul li a {
font-weight: normal;
display: block;
width: 254px;
height:34px;
padding: 0px 0px 0px 30px;
border-left: 20px solid #2175BD;
background-color: #135894;
color: #fff;
text-decoration: none;
line-height: 34px;
}
#navigation ul li a:hover {
font-weight: normal;
border-left: 20px solid #2175BD;
width: 272px;
padding: 0px 0px 0px 12px;
background-color: #2175BD;
color: #7BBDFA;
}
#navigation ul {
font-weight: normal;
list-style: none;
margin: 0;
padding: 0;
}
#navigation ul li {
font-weight: normal;
margin: 0;
border-top: 1px solid #fff;
}
html>body #navigation ul li a {
width: auto;
}
a:hover, .selected a {
font-weight: normal;
border-left: 20px solid #2175BD;
width: 272px;
padding: 0px 0px 0px 12px;
background-color: #2175BD;
color: #7BBDFA;
} |
html:
code:
1
2
3
4
5
6
7
8
9
10
11
| <div id="navContainer">
<div id="navigation">
<ul>
<li class="selected"><a href="index.html">Home</a></li>
<li><a href="a.html">a</a></li>
<li><a href="b.html">b</a></li>
<li><a href="c.html">c</a></li>
<li><a href="d.html">d</a></li>
</ul>
</div>
</div> |
blijkbaar kan je bij een list niet een class laten overrulen?
Huub Huub Barbatruc!