HTML5属性:margin属性的用法实例
<!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>
运行效果如下:
相关推荐:
HTML5属性:form表单属性的用法实例
HTML5中div标签的实例代码
以上就是HTML5属性:margin属性的用法实例的详细内容,更多请关注jquery中文网其它相关文章!
-->您可能感兴趣的文章:
html5 source标签怎么用?html5 source标签属性介绍
HTML5属性:margin属性的用法实例
HTML5属性:select属性的代码实例
html5中布尔属性的hidden
CSS手册简编:BOX属性
html5存储页面或应用程序的私有自定义数据的data-* 属性
html5 meter标签是什么意思?html5 meter度量衡如何改变颜色详解
html5 source type有什么用处?html5 source标签的详细介绍
HTML5新增属性:classList属性的使用方法
html5 track标签是什么意思?html5 track标签的使用方法介绍