Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> p { background-color: yellow; } p.ex { border:1px solid red; margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; } </style> </head> <body> <h2>Using Individual margin Properties:</h2> <p>This is a paragraph with no specified margins.</p> <p class="ex">This paragraph has a top and bottom margin of 100px, a left margin of 80px, and a right margin of 150px.</p> </body> <!-- Mirrored from www.w3schools.com/css/tryit.asp?filename=trycss_margin_sides by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 13 Mar 2016 11:02:56 GMT --> </html>
Result: