PDA

View Full Version : CSS displays differently in FF and IE!



simonafeonline
Aug 20th, 2009, 01:11 PM
I have a menu here: www.flighttrainingnews.co.uk which I have adjusted to work in FF. However the instruction i've given to IE doesn't seem to work.
Here's my code:

ul.menu {
background-color: #1b7bdb;
list-style: none;
margin-left: 0px;
}
html>body ul.menu {
background-color: #1b7bdb;
list-style: none;
margin-left: -36px;
}

I thought from reading articles, that by creating these two commands named both ul.menu that the browsers would look to the second one to take priority. I also thought that IE would not understand the second one because of the html>body part and therefore revert to the first and taking the command of margin-left: 0px. FF and other browsers would understand the html>body part and therefore use the second command of margin-left:-36px.

Problem is that IE understands the second and is also using a margin-left of -36px!

I need to alter this so that IE doesn't understand the second command but the other browsers do - please help!

ktsixit
Aug 20th, 2009, 04:25 PM
try add padding:0 in your css classes. I think that the fact that you have not set padding for your list, is causing this problem

simonafeonline
Aug 20th, 2009, 05:39 PM
thanks for the thought, but it didn't work....

ul.menu {
background-color: #1b7bdb;
list-style: none;
margin-left: 0px;
padding: 0px;
}
html>body ul.menu {
background-color: #1b7bdb;
list-style: none;
paddiing: 0px;
}

if you view it now in IE and FF you'll see what i mean...

abduraooft
Aug 20th, 2009, 05:47 PM
if you view it now in IE and FF you'll see what i mean... I can't see any difference when viewed in FF2 and IE6. Also, adding margin-left:-36px; hides the left half of those list items in FF.

simonafeonline
Aug 20th, 2009, 05:57 PM
you're right, it's suddenly working!

i've just seen my fault. i only initially changed padding:0px in html>body ul.menu but spelt padding wrong. when i changed it in ul.menu it worked.

problem sorted, thanks all for your help!