CodeLab
Tutorials For Everyone
Run
<!Doctype HTML> <html> <head> <title>CSS Margins Property</title> <style> .para1{border: 2px solid #29b6f6; padding: 10px; text-align: center; margin: 100px;} .para2{border: 10px solid #555555; padding: 10px; text-align: center; margin-left: 50px;} </style> </head> <body> <h2>CSS Margins Property</h2> We can set the margin of an element by Css margin property. <p class="para1"> This paragraph has a margin of 100px on all sides; </p> <p class="para2"> This paragraph has a margin of 50px only on left side. </p> </body> </html>