下面我们通过具体的代码示例,为大家一一详解。
这里有一段csspadding属性使用示例代码如下:
<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8">
<title>csspadding属性使用示例</title>
<style>
div{
width:400px;
height:80px;
border:2pxsolidred;
margin-top:10px;
}
.p1{padding:10px;}
.p2{padding:20px30px;}
.p3{padding:10px5px15px20px;}
</style>
</head>
<body>
<divclass="p1">
<p>csspadding内边距属性示例1-给此段文字添加了padding:10px;的样式。</p>
</div>
<divclass="p2">
<p>csspadding内边距属性示例2-给此段文字添加了padding:20px30px;的样式。</p>
</div>
<divclass="p3">
<p>csspadding内边距属性示例3-给此段文字添加了padding:10px5px15px20px;的样式。</p>
</div>
</body>
</html>

本文转载自中文网

本文转载自中文网
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c56926.shtml