|
Posted by Michael Winter on 12/07/42 11:44
On 09/04/2006 11:10, David Graham wrote:
[snip]
> http://homepage.ntlworld.ie/spartanicus/HCS/masthead.htm
[snip]
> #masthead div{clear:both;height:1px;background:#fff;font:0\0}
^^^
The backslash in that font declaration should be a forward slash, by the
way. I know: it's Spartanicus' code.
> The clear:both is obviously doing a lot of work here but why does
> it's presence mean the blue background of the parent masthead div
> gets displayed and not without it?
Much of the content of that masthead is floated, and floats are taken
out of the flow. The result is that they don't take up any vertical
space, as far as the containing div element is concerned, so it
collapses. Specifying the both value for the clear property forces the
inner div element below the floats, stretching the container in the
process.
> Is the greater specificity the reason why this white background does
> not get over ruled by the blue background of the parent masthead div
> or it simply due to the stacking order i.e. the child div is more
> infront than the parent div?
The latter.
> Hope Mr Spartanicus is around or one of the guru's
I believe you meant, "one of the _other_ guru's". I think Spartanicus
qualifies as one himself. ;-)
Mike
--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Navigation:
[Reply to this message]
|