Ie Floats Not Links

From CSS Discuss

Jump to: navigation, search

Float Bug in Internet Explorer for Windows

  • The Symptom: Sometimes when a div contains only anchor tags, and is floated, the links will become "unlinked". They'll still be styled as links, but you will no longer be able to click on them, nor will the :hover pseudo-element have any effect.
  • The Cause: Unknown/Inconsistent
  • The Work-Around: Add {position:relative;} to the style sheet element containing the links (its parent). For example:
  • For markup like:
<div id="links">
	<a href="http://www.domain.com">Link One</a>
	<a href="http://www.anotherdomain.com">Link Two</a>
</div>
  • You would need to add this to your CSS:
#links {position: relative;
	float: right;
	color: blue;
	background: transparent;
}
  • This problem shows up in:
    • IE5/Win
    • IE5.5/Win
    • IE6/Win

Any other browsers?

Personal tools