Previous Message
Next Message

Divs not placing without border on

Sent by Gunlaug_Sørtun on 25 May 2008 11:11


Anne Pennington wrote:
> I have a problem which is occurring on two sites I am working on. A
>  div is not sitting vertically where it should without a border round
>  the div containing it.

> http://www.jhughes-psychotherapist.co.uk/test/index3.html

> http://www.jhughes-psychotherapist.co.uk/test/index4.html

You're running into cases with "collapsing margins"[1].
IE7 and older are "saved" by their 'hasLayout' bug, while other browsers
need something to prevent the vertical margin on the navigation from
escaping the containing-element - #header.

Declaring 'padding-top: 1px;' instead of a border is the simplest
solution, but other "options" are listed in the specs on the subject.


BTW: IE6 (at least) needs a 'hasLayout' trigger on the navigation.
Adding...

#navigation a {
height: 1%;
}

....will do.

regards
	Georg

[1]http://www.w3.org/TR/CSS21/box.html#collapsing-margins
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: