Margin Collpase CSS - Tryit Editor for Web Developers
Edit This Code:
See Result »
<html> <head> <style> h1 { margin: 20px 0px 80px 0px; } h2 { margin: 100px 0px 0px 0px; } p { text-align: left; font-size: 30px; color: blue; } </style> </head> <body> <p>Margin-Collpase</p> <p>Top and bottom Margins of elements are sometimes collapsed into a single Margin that is equal to the largest of the two Margins.... This does not happen on left and right Margins. Only Top and Bottom margins</p> <h1>Welocme To CSS</h1> <h2>Property of Margin</h2> <img src="logo.jpg"/> </body> </html>
Result: