What will be the margin between two blocks <div> and <p>?

<body>
<div id="d1">...</div>
<p id="p1">...</p>
</body>

#d1 {
margin-bottom:30px;
padding:0;
}
#p1 {
margin-top:20px;
padding:0;
}
Explanation
Two margins set in two adjacent blocks are not summed.
The browser uses the one that is more of them by value.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback