PDA

View Full Version : css menu



sidhu
August 3rd, 2007, 03:29 AM
helo all,

i am traing make a css menu,but it good in IE and not work in Firfox,what is going wrong in my code ,plese help me.
sidhu>G


#ul{
width:100px;
padding:5px;


background-color:#000000;
text-align:center;
}
#ul li{
display:block;
}
#ul li a{
float:left;
padding:10px;


width:100%;
background-color:#FFFFFF;
color:#000000;

text-decoration:none;
}
#ul li a:hover{



width:100px;
background-color:#FF0000;

text-decoration:none;
}
</style>
</head>

<body>
<ul id="ul">

<li><a href="gallery.html">Gallery</a></li>

<li><a href="about.html">About</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="products.html">Products</a></li>
</ul>

LJK
August 3rd, 2007, 01:13 PM
Hi -
It's always a good idea to set default padding: and margin: w/ a <ul>,
so throw in margin:0 auto; to be safe.

Did you clear the floated <a>'s inside of the <li>'s? IE will often 'fix' code, whereas F-fox is
going to show the errors ;-)

El

chriskalani
August 7th, 2007, 11:47 AM
Another thing that usually gives you the right amount of control over lists is usually to display: block; I find that helps out a lot as well.