Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

li a{ problem in IE 1

Status
Not open for further replies.

Aron2

Programmer
Aug 19, 2006
37
CA
I'd like to use an unordered list for the menu of a sit I'm working on. It seems simple enough, but for some reason IE isn't displaying a top border. Any help would be great.

Code:
<style type="text/css">
    ul{
    	margin:0px;
    	padding:0px;
    }
    li{
    	display:inline;
    	list-style-type:none;
    	margin:0px 0px 0px 3px;
    }
    li a{
    	border-top:2px solid #000;
    	border-left:2px solid #000;
    	border-right:2px solid #000;
    	border-bottom:0px;
    	padding:0px 3px 0px 3px;
    	text-decoration:none;
    }
    li a:hover{
    	color:#fff;
    	background:#000;
    }
</style>

<ul>
  <li>
    <a href="">Blog Home</a>
  </li>
  <li>
    <a href="">Register</a>
  </li>
  <li>
    <a href="">Make New Post</a>
  </li>
</ul>
 
It is one of those weird IE disappearing problems. Luckily, the solution is easy. Add [tt]position: relative;[/tt] to your [tt]li a { }[/tt] declaration and you should be fine.
 
Thanks a ton. I can't check it right now (on my linux box), but it sounds like it'll work.
 
I checked it, and it works.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top