Le 13 mai 2013 à 11:08, COM <j...@coffeeonmars.com> a écrit : > On May 12, 2013, at 7:04 PM, Alan Gresley <a...@css-class.com> wrote: > >> No, you simply have collapsing margins. Just change the value of the top >> margin to zero. Like so. >> >> header{ >> margin:0 0 1em 0; >> border:red 1px solid; >> } > > Thank you. Couple questions…I did have a border on the header..isnt that > supposed to prevent the collapsing margins scenario?
That border will prevent collapsing-through of top/bottom margins of child elements of your <header>, not the margins on the <header> itself. > > Also, need to have a top margin value for the header so that I can position > it vertically where I need it to, so am I forced to use padding for this? Assuming the <header> is the first child of <body>, you could set some padding-top on the body element. > ..off to read the link you provided Good. And then create simple test cases to play with. Add a bit of background colours to the elements in your test cases to see what goes where. If you don't understand what happens in one (as minimal as possible) test case, post it somewhere and ask questions to the list. Philippe -- Philippe Wittenbergh http://l-c-n.com ______________________________________________________________________ css-discuss [css-d@lists.css-discuss.org] 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/