Jump to content

Position: Absolute; different in Chrome, FireFox AND IE!?


Recommended Posts

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.

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.