Jump to content

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


FalseProphet

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.