I have a similar promblem.
I have a small menu at the bottom of this page and it looks odd in Firefox - it sits slightly to the left rather than centred as it does in IE. To be honest, I do this with IE in mind because the vast majority of people use it.
I wonder if you could help me get it centred in both Firefox and IE...
I'm sorry if the css is a little confusing (it's pretty looong).
I had thought before that that might be the problem, but I've changed that (here ) and it floats to the left in Firefox. I think the reason for this is the way the menu is made (I saw this in this forum) - it uses float:left to build the 'cells' (I think). I could change the menu back to how I had it before, but the code didn't look as 'clean' as this does (lots of spaces and use of '|' ).
What do you think? Maybe I shouldn't use this code (with the 'float:left')?
The float:left allows the menu to display horizontally. Usually display:inline is used.
If it works for you leave it.
There are however problems with the css. A validation will reveal some of these.
Other points to note are:
z-index is a unique number.
Having multiple elements with the same z-index is pointless and impossible. The browser will change any duplicate values it finds.
All those position:absolute elements, are they really necessary. Whenever possible leave elements in the natural flow of the document.
overflow : hidden; in html and body can make you page inaccessible , especially on smaller screens.
CSS declaration duplication; i.e. font-family and background. Use selector grouping: body, html { font-family: ....}
I appreciate the advice and I'm trying to put more things 'in the flow' of the document now (though having crazy problems).
As for the problem I was asking about (my non-centring menu)... I changed it from 'float:left' to 'display:inline' but it just totally messed it up. What I had before was a div with lots of spans forming the menu with ' | ' between the spans. This actually worked fine, but the code didn't look pretty (if you know what I mean) - I figured cleaner code is generally better.
Thanks again - maybe I'll get back to you with more problems soon...
Bookmarks