Forum Moderators: not2easy
It works fine in IE 5.5 and 6, Netscape 6.2 and up, and Mozilla browsers. Only IE 5 has the problem.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"><html>
<head>
<title>Dropdown Test</title>
<style type="text/css">
body {font-size: 100%; font-family: arial, verdana, sans-serif;}
a:link {
color: #000;
display: block;
float: left;
width: 200px;
border: 1px solid #000;
height: 20px;
}a:visited {
color: #000;
display: block;
float: left;
width: 200px;
border: 1px solid #000;
height: 20px;
}a:hover {
color: #000;
display: block;
float: left;
width: 200px;
border: 1px solid #000;
height: 20px;
background: #cee;
}a:active {
color: #000;
display: block;
float: left;
width: 200px;
border: 1px solid #000;
height: 20px;
}</style>
</head>
<body>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<a href="#">Link 4</a>
<a href="#">Link 5</a>
<a href="#">Link 6</a>
<a href="#">Link 7</a>
<a href="#">Link 8</a>
<a href="#">Link 9</a>
<a href="#">Link 10</a>
<a href="#">Link 11</a>
<a href="#">Link 12</a>
<a href="#">Link 13</a>
<a href="#">Link 14</a>
<a href="#">Link 15</a>
<a href="#">Link 16</a>
<a href="#">Link 17</a>
<a href="#">Link 18</a>
<a href="#">Link 19</a>
<a href="#">Link 20</a></body>
</html>
aelement rather than it's pseudo-classes?
<style type="text/css">
body {font: 100% arial, verdana, sans-serif; }
a {
color: #000;
display: block;
float: left;
width: 200px;
border: 1px solid #000;
height: 20px;
}
a:hover, a:active {
background: #cee;
}
</style>
Adam
It's the combination of float and hover that does it. I've lost the place where I found out what the bug is, but I solve it by surrounding the floated items in an extra div. The rules for the div are:
{ width:75%;
margin-left:auto;
margin-right:auto;
margin-top:0;
margin-bottom:0; }
but I can't remember which of these fixes it.
Hope that's helpful. But at least you know you're not imagining things (to those who haven't seen this: you definitely think you're going mad when it occurs).
At least I know I hadn't lost my sanity; I wondered for awhile! I mean, imagine the most bizarre, off-the-wall behavior you can think of for a browser. This bug beats it hands down . . .
Just for the record (so that it doesn't confuse any later readers) what I said (or meant to say) was that the CSS rule did work for me, but that I couldn't remember which bit was the crucial thing to do. From you post, Matthew, it seems that "div" was the key part ;)
But, get this. My code above has enough links that they're almost certain to wrap to several rows, resembling a table. Put that many links in a non-floated div, and they'll jump down once. But, if you remove enough links that you only have one row, a non-floated div does the trick, like you said.
Apparently it has something to do with the floated links being out of the flow of the document, so multiple rows need to be actually contained in another element.
Wouldn't our job be boring without all this? ;)