Skip to content

24 ways to impress your friends

Vote down?

bart

Watch out for vertical margin collapsing when nesting block level elements. For example, #footer .inner {margin:10px;} only renders horizontal margins. Vertical margins have been collapsed with container’s margins. In this instance margin:10px; is equivalent to margin:0 10px;. If this was the desired effect, then that’s fine. In any case, just wanted to point that out for the newbies’ sake. By the way, put a padding:1px 0; or border:1px solid red; border-width:1px 0; on the container (#footer) and see the difference.