I am facing an issue with my CSS code where using margin: 0
instead of margin-top: 0
for header p
seems to make the header { margin: 0 0 20px; }
rule ineffective. Is this how it is supposed to work? Upon inspecting in Firebug, it appears that the margin-bottom
property of header
collapses into the next sibling element, which is the section
.
Here's the HTML snippet:
<header>
<h1>ToDo List</h1>
<p>HTML5 Offline Capable Web Application</p>
</header>
CSS Code:
header { font: 24px/1em Notethis; color: #666; margin: 0 0 20px; }
header h1 { font: 60px/1.4em Hetilica; margin: 0; }
header p { margin-top: 0; }