![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm using the example in http://www.alistapart.com/stories/practicalcss/> to create a navigation bar without using tables. The navigation buttons float to the left and the logo floats to the right. To keep the containing div from collapsing there is an empty div with style="clear: both;" at the end. This works so long as there is a border to the containing div. If there is no border then the background color is not set - just as if the containing div had collapsed to nothing. URL? |
#3
| |||
| |||
|
|
URL? |
#4
| |||
| |||
|
| http://www.alexfarran.com/mozbug Fiddling around a bit it looks like background colour only extends as far as the lines where there is non floated content, and not to the bottom of the div as you'd expect. Layout is unaffected. That's very interesting. I can't think of a reason why the borders |
#5
| |||
| |||
|
| http://www.alexfarran.com/mozbug Fiddling around a bit it looks like background colour only extends as far as the lines where there is non floated content, and not to the bottom of the div as you'd expect. Layout is unaffected. |
#6
| |||
| |||
|
|
In article <MPG.197286f45e2e31a5989bf2 (AT) news (DOT) CIS.DFN.DE>, Jacqui or (maybe) Pete wrote: In article <m3n0fsx9mr.fsf (AT) localhost (DOT) localdomain>, alex (AT) alexfarran (DOT) com says... ... http://www.alexfarran.com/mozbug Fiddling around a bit it looks like background colour only extends as far as the lines where there is non floated content, and not to the bottom of the div as you'd expect. Layout is unaffected. .... http://porjes.com/ala.html I've just put a (non-floated) space between the two spans, which sets .... But you also set the height of div. (1.4em). Does it work whitout? Works on Opera 7.2b1, but so did all others. No, it didn't! I'd forgotten I'd put that height in. |
#7
| |||
| |||
|
|
Alex Farran wrote: http://www.alexfarran.com/mozbug> Fiddling around a bit it looks like background colour only extends as far as the lines where there is non floated content, and not to the bottom of the div as you'd expect. Layout is unaffected. If the only things in the div are floated about, and there's no border, there's no height to the div, is there? |
|
That's what Mozilla's DOM inspector seems to indicate. |
#8
| |||
| |||
|
|
In article <MPG.197286f45e2e31a5989bf2 (AT) news (DOT) CIS.DFN.DE>, Jacqui or (maybe) Pete wrote: OTOH, I can give you a simple fix for the problem (if you have a problem). See: http://porjes.com/ala.html I've just put a (non-floated) space between the two spans, which sets the height of the div. Of course if you have bolding or font sizes on the spans then you also have to apply them to the div (so that the space is the same height as the spans). But you also set the height of div. (1.4em). Does it work whitout? Works on Opera 7.2b1, but so did all others. |
#9
| |||
| |||
|
|
In article <o87Oa.22626$9v4.5381 (AT) news02 (DOT) roc.ny>, revhippie (AT) frontiernet (DOT) net says... If the only things in the div are floated about, and there's no border, there's no height to the div, is there? Yeah, but he's got a 'clear:both' div in there. |
#10
| |||
| |||
|
|
Normally, but there is a spacer div at the bottom with "clear: both;" set that ought to give the containing div some height. If you were to remove it from the containing div with a border then it wouldn't have any height either. |
|
That's what Mozilla's DOM inspector seems to indicate. That looks useful. I think I'll install it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |