hoe dit horizontale menu in IE werkend krijgen?
Ik heb een mooi menuutje gemaakt, maar in IE krijg ik het niet werkend. Wat moet er veranderd worden?
Code (php)
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
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
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<ul class="nav">
<li><strong>a navigation item</strong>
<ul>
<li>a navigation list item</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</li>
<li><strong>a navigation item</strong>
<ul>
<li>another navigation list item</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</li>
<li>...</li>
...
</ul>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<ul class="nav">
<li><strong>a navigation item</strong>
<ul>
<li>a navigation list item</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</li>
<li><strong>a navigation item</strong>
<ul>
<li>another navigation list item</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</li>
<li>...</li>
...
</ul>
Code (php)
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
68
69
70
71
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
68
69
70
71
/*** Nav bar styles ***/
ul.nav,
.nav ul{
/*Remove all spacings from the list items*/
margin: 0;
padding: 0;
cursor: default;
list-style-type: none;
display: inline;
}
ul.nav{
display: table;
}
ul.nav>li{
display: table-cell;
position: relative;
padding: 2px 6px;
}
ul.nav li>ul{
/*Make the sub list items invisible*/
display: none;
position: absolute;
max-width: 40ex;
margin-left: -6px;
margin-top: 2px;
}
ul.nav li:hover>ul{
/*When hovered, make them appear*/
display : block;
}
.nav ul li a{
/*Make the hyperlinks as a block element, sort of a hover effect*/
display: block;
padding: 2px 10px;
}
/*** Menu colors (customizable) ***/
ul.nav,
.nav ul,
.nav ul li a{
background-color: #fff;
color: #369;
}
ul.nav li:hover,
.nav ul li a:hover{
background-color: #369;
color: #fff;
}
ul.nav li:active,
.nav ul li a:active{
background-color: #036;
color: #fff;
}
ul.nav,
.nav ul{
border: 1px solid #369;
}
.nav a{
text-decoration: none;
}
ul.nav,
.nav ul{
/*Remove all spacings from the list items*/
margin: 0;
padding: 0;
cursor: default;
list-style-type: none;
display: inline;
}
ul.nav{
display: table;
}
ul.nav>li{
display: table-cell;
position: relative;
padding: 2px 6px;
}
ul.nav li>ul{
/*Make the sub list items invisible*/
display: none;
position: absolute;
max-width: 40ex;
margin-left: -6px;
margin-top: 2px;
}
ul.nav li:hover>ul{
/*When hovered, make them appear*/
display : block;
}
.nav ul li a{
/*Make the hyperlinks as a block element, sort of a hover effect*/
display: block;
padding: 2px 10px;
}
/*** Menu colors (customizable) ***/
ul.nav,
.nav ul,
.nav ul li a{
background-color: #fff;
color: #369;
}
ul.nav li:hover,
.nav ul li a:hover{
background-color: #369;
color: #fff;
}
ul.nav li:active,
.nav ul li a:active{
background-color: #036;
color: #fff;
}
ul.nav,
.nav ul{
border: 1px solid #369;
}
.nav a{
text-decoration: none;
}
Gewijzigd op 01/01/1970 01:00:00 door Superman
Hier heb je die van mij:
(html)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<div id="menu">
<ul>
<li><a class="menu" href="http://test.ehvdames1.nl/index.php">Home</a></li>
<li onmouseover="this.className='msieFix'" onmouseout="this.className=''" ><a class="menu" href="#">Artikelen</a>
<br />
<br />
<ul>
<li><a href="http://test.ehvdames1.nl/artikelen/001.php">Waldnet 16-10-2006</a></li>
<li><a href="http://test.ehvdames1.nl/artikelen/002.php">De Gelderlander 16-10-2006</a></li>
<li><a href="http://test.ehvdames1.nl/artikelen/003.php">De Stentor 16-10-2006</a></li>
</ul>
</li>
</ul>
</div>
<ul>
<li><a class="menu" href="http://test.ehvdames1.nl/index.php">Home</a></li>
<li onmouseover="this.className='msieFix'" onmouseout="this.className=''" ><a class="menu" href="#">Artikelen</a>
<br />
<br />
<ul>
<li><a href="http://test.ehvdames1.nl/artikelen/001.php">Waldnet 16-10-2006</a></li>
<li><a href="http://test.ehvdames1.nl/artikelen/002.php">De Gelderlander 16-10-2006</a></li>
<li><a href="http://test.ehvdames1.nl/artikelen/003.php">De Stentor 16-10-2006</a></li>
</ul>
</li>
</ul>
</div>
Voeg de rest van html code maar toe en gebruik doctype strict.
(css)
Code (php)
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
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
#menu {
background-color: rgb(4,25,67);
color : #000;
height : 31px;
width : 100%;
padding : 2px 0;
font-size : 13px;
}
#menu ul {
list-style: none;
padding: 0;
margin: 0;
}
#menu li {
float : left;
margin : 0.2em 0.2em;
}
#menu li a.menu {
background-color : rgb(4,25,67);
height : 24px;
line-height : 24px;
float : left;
width : 7em;
display : block;
border : 1px solid rgb(255,141,41);
color : rgb(255,141,41);
text-decoration : none;
text-align : center;
}
li ul { display: none; }
li:hover ul, li.msieFix ul {
display : block;
position : absolute;
width : 12em;
background-color : rgb(4,25,67);
color : rgb(255,141,41);
border : 1px solid rgb(255,141,41);
}
background-color: rgb(4,25,67);
color : #000;
height : 31px;
width : 100%;
padding : 2px 0;
font-size : 13px;
}
#menu ul {
list-style: none;
padding: 0;
margin: 0;
}
#menu li {
float : left;
margin : 0.2em 0.2em;
}
#menu li a.menu {
background-color : rgb(4,25,67);
height : 24px;
line-height : 24px;
float : left;
width : 7em;
display : block;
border : 1px solid rgb(255,141,41);
color : rgb(255,141,41);
text-decoration : none;
text-align : center;
}
li ul { display: none; }
li:hover ul, li.msieFix ul {
display : block;
position : absolute;
width : 12em;
background-color : rgb(4,25,67);
color : rgb(255,141,41);
border : 1px solid rgb(255,141,41);
}
Check maar hoe ik het heb gedaan. Je zult de verschillen misschien wel zien. Trouwens het is volledig xhtml1 valid. :D
Getest en werkend in IE5 en hoger(lager weet ik niet), FF alle versie, Opera, Safari, Netscape en nog wat onbekende.
Gewijzigd op 01/01/1970 01:00:00 door CB2thephp