<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Margin for All Sides At Once</title> <style> h1 { margin: 55px; /* apply to all four sides */ } p { margin: 30px 80px; /* vertical | horizontal */ } div { margin: 30px 55px 80px; /* top | horizontal | bottom */ } hr { margin: 25px 50px 75px 100px; /* top | right | bottom | left */ } h1, p, div { background: purple; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a frist paragraph.</p> <div>This is a next paragraph..</div> <hr> <p><strong>Note:</strong> This is a most important paragraph.</p> </body> </html>