So I am trying to set up vertical rhythm on a page. But p
is not respecting bottom margin of h1
. Can someone explain me why?
Here is my code (em units would be better but for the sake of simplicity I have used pixels ):
html {
font - size: 18px;
line - height: 1.5;
}
h1 {
font - size: 30px;
line - height: 1.5;
margin: 4.5px 0 4.5px;
}
p {
margin: 27px 0;
}
<body>
<h1>blaasdfasf</h1>
<p>...</p>
</body>
Edit:
Here you can see what i mean:
The margin of h
is ignored as you can se.