如何在一个声明中设置CSS边距属性?
的 余量属性定义围绕一个HTML元素的空间。可以使用负值来重叠内容。它指定一种简写属性,用于在一个声明中设置边距属性。
示例
您可以尝试运行以下代码来设置边距
<html>
<head>
</head>
<body>
<p style = "margin: 20px; border:2px solid yellow;">
All four margins will be 20px
</p>
<p style = "margin: 15px 4% -10px; border:2px solid red;">
Top margin will be 15px, left and right margin will be 4% of the total width of the document, bottom margin will be -10px
</p>
</body>
</html>热门推荐
10 香港老妈结婚祝福语简短
11 毕业立体贺卡祝福语简短
12 简短新年年会祝福语
13 评论小品祝福语大全简短
14 恭喜师兄结婚祝福语简短
15 员工集体辞职祝福语简短
16 高中新生祝福语 简短
17 装修祝福语男生搞笑简短
18 生日开业蛋糕祝福语简短