Home > Article > Web Front-end > HTML5 attributes: Usage examples of margin attribute
This article introduces to you about HTML5 attributes: usage examples of margin attributes. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> p{ width: 100px; height: 100px; background-color: red; /* 外边距 */ margin-top: 30px; margin-left: 100px; margin-right: 100px; margin-bottom: 100px; /* 连写 */ margin: 40px; margin: 0 auto; /* 内边距 pandding */ padding: 30px; } </style> </head> <body> <p>p第一个</p> <p>p第二个</p> </body> </html>
The operation effect is as follows:
Related recommendations:
HTML5 attributes: Usage examples of form form attributes
Example code of div tag in HTML5
The above is the detailed content of HTML5 attributes: Usage examples of margin attribute. For more information, please follow other related articles on the PHP Chinese website!