4 replies [Last post]
Tom L
Tom L's picture
Offline
Enthusiast
Liverpool
Last seen: 9 years 23 weeks ago
Liverpool
Timezone: GMT+1
Joined: 2005-09-23
Posts: 91
Points: 2

Hi.

My mate is doing a site and is having some trouble. So I helped him rejig the header as it was a huge mess. Anyway, I'm having problems with the menu he asked me to help out with.

Sorry for what will be a poor explanation but I'm actually on a training course as I type!

Here are two versions of the thing:

http://tomleadbetter.co.uk/test/nofloat.html
http://tomleadbetter.co.uk/test/float.html

In IE, the float.html is what I want. But in FF it acts as if there is no padding under the LI elements.

the "float" or "nofloat" refers to how I have positioned the li a tags.

Gotta shoot now but if anyone fancies having a bash at it, please do! I know the list items are fixed pixels which is a "no-no" but it aint my site Smile

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 49 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

For float.html, add

For float.html, add overflow: hidden to #nav ul.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Tom L
Tom L's picture
Offline
Enthusiast
Liverpool
Last seen: 9 years 23 weeks ago
Liverpool
Timezone: GMT+1
Joined: 2005-09-23
Posts: 91
Points: 2

woo!

Tyssen, that works a treat Smile Thank you.

So what exactly does the overflow:hidden do? It never occured to me to try that.

Always learning.....

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 1 year 46 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Hugo's not online right now,

Hugo's not online right now, so I'll answer that one.

IE6 and before takes height as min-height. So they will expand a box as the content dictates (often when you don't think it should!).

Overflow:hidden says if the content doesn't fit, chop off the bottom of what doesn't fit. As that is often just whitespace when IE is involved, who cares?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Was that my name I heard

Was that my name I heard being written?

Overflow other than default visible forces the element to have to enclose it's children fully ensuring that their boundary sits within it.

There was an interesting post dissecting the issue years back when the use of overflow had begun to be used to provide clearing. It was in 'Geeks' section but I haven't been able to track it down Sad

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me