This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="margin-bottom: 20px;">a</div> | |
<p style="margin-top: 10px">b</p> | |
The above code will result a margin of 20px rather than 30px between div and p.
Second, we can set border-collapse: collapse; to table element, which will collapse the interleaving space of table cells. border-collapse: seperate; will do the opposite.
What if we want collapse margin even border of any two adjacent elements? Just set the according margin of the first element to a negative value. It's amazing and works good. Try it!
No comments:
Post a Comment