FalseProphet Posted March 3, 2011 Share Posted March 3, 2011 I have a styled Unordered List that appears all over the place in these three browsers. In Chrome, the list looks just fine, in Internet Explorer, it's borked. I set up a new style just for IE(using conditional comments) and that fixed it for the most part. Now, FireFox just doesn't seem to want to fall into line. I was expecting the page to look exactly like it does in Chrome however, it doesn't. It resembles Internet Explorer's version before I introduced it's own stylesheet. Doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> CSS in question: div.navbar-content { position:absolute; left: 60px; top: 20px; } ul { list-style:none; } li { float:right; padding:0px 15px 5px; } Why is this broken so? I can't see any reason it wouldn't work properly in FireFox. Are there any tricks I can use in detecting if the users browser is FireFox? I've tried using PHP's get_browser() function but that always reports browser => default browser no matter what browser I use. Quote Link to comment https://forums.phpfreaks.com/topic/229461-position-absolute-different-in-chrome-firefox-and-ie/ Share on other sites More sharing options...
cssfreakie Posted March 3, 2011 Share Posted March 3, 2011 3 questions: do you use a reset.css? (like meyer's reset.css) why you use float on the li? isn't text-align a better option? is your doctype valid..: does it have a space between language and url? -edit: if you have it online somewhere it's easier to fix it. Quote Link to comment https://forums.phpfreaks.com/topic/229461-position-absolute-different-in-chrome-firefox-and-ie/#findComment-1182459 Share on other sites More sharing options...
FalseProphet Posted March 4, 2011 Author Share Posted March 4, 2011 I fixed the issue, it was caused by using float:left; in the wrong place. I am using float to create a horizontal unordered list. Are there better ways? Quote Link to comment https://forums.phpfreaks.com/topic/229461-position-absolute-different-in-chrome-firefox-and-ie/#findComment-1182676 Share on other sites More sharing options...
cssfreakie Posted March 5, 2011 Share Posted March 5, 2011 yes there are, display inline on any list will make it horizontal. (ul is a block element) Quote Link to comment https://forums.phpfreaks.com/topic/229461-position-absolute-different-in-chrome-firefox-and-ie/#findComment-1183382 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.