实例代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.div-box{
width:610px;
float:left;
}
.div-counded{
width:300px;
height:300px;
float:left;
}
.corners1{
border-radius:15px 50px 30px 5px;
background-color:green;
width:200px;
height:150px;
padding:12px;
}
.corners2{
border-radius:15px 50px 30px ;
background-color:green;
width:200px;
height:150px;
padding:12px;
}
.corners3{
background-color:green;
width:200px;
border-radius:15px 50px ;
height:150px;
padding:12px;
}
.corners4{
width:200px;
background-color:green;
border-radius:15px ;
height:150px;
padding:12px;
}
</style>
</head>
<body>
<h1>border-radius 属性</h1>
<div class="div-box">
<div class="div-counded" >
<p>四个值-border-radius:15px 50px 30px 5px </p>
<p class="corners1">四个圆角的半径各不相同!</p>
</div>
<div class="div-counded">
<p>三个值-border-radius:15px 50px 30px</p>
<p class="corners2">三个圆角有两个半径相同!</p>
</div>
<div class="div-counded">
<p>两个值-border-radius:15px 50px</p>
<p class="corners3">每两个对顶圆角半径相同!</p>
</div>
<div class="div-counded">
<p>一个值-border-radius:15px </p>
<p class="corners4">四个圆角半径相同!</p>
</div>
</div>
</body>
</html>
</body>
</html>
运行效果:
![](/sites/default/files/inline-images/rounded-3.png)
评论