CodeLab
Tutorials For Everyone
Run
<!Doctype HTML> <html> <head> <title>CSS Margins for Individual Sides</title> <style> .p3{ padding: 50px; background: #29b6f6; color: #fff; text-align: center; margin: 100px 20px 50px; } .p2{ padding: 50px; background: #29b6f6; color: #fff; text-align: center; margin: 20px 50px; } .p1{ padding: 50px; background: #29b6f6; color: #fff; text-align: center; margin: 50px; } </style> </head> <body> <h2>CSS Margins with three values for margin property</h2> <div style="border: 5px solid #555;"> <p class="p3"> This paragraph element has margin values as (margin: 100px 20px 50px;) </p> </div> <br/> <h2>CSS Margins with three values for margin property</h2> <div style="border: 5px solid #555;"> <p class="p2"> This paragraph element has margin values as (margin: 20px 50px;) </p> </div> <br/> <h2>CSS Margins with three values for margin property</h2> <div style="border: 5px solid #555;"> <p class="p1"> This paragraph element has margin values as (margin: 50px;) </p> </div> </body> </html>