CodeLab
Tutorials For Everyone
Run
<!Doctype HTML> <html> <head> <title>CSS Margin Property With Auto Value</title> <style> div{ border: 5px solid #29b6f6; } p.p1{ margin: auto; width: 300px; } </style> </head> <body> <h2>CSS Margin Property With Auto Value</h2> <div> <p class="p1"> This paragraph has equal margin on both sides due to (auto) value of margin property. </p> </div> </body> </html>