实例代码:
<!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:50px / 15px;
background-color:green;
width:200px;
height:150px;
padding:12px;
}
.corners2{
border-radius:15px / 50px ;
background-color:green;
width:200px;
height:150px;
padding:12px;
}
.corners3{
background-color:green;
width:200px;
border-radius: 50% ;
height:150px;
padding:12px;
}
[class*=corners]{
text-align:center;
}
</style>
</head>
<body>
<h1>border-radius 属性</h1>
<div class="div-box">
<div class="div-counded" >
<p>椭圆边框 - border-radius: 50px / 15px: </p>
<p class="corners1">椭圆边框</p>
</div>
<div class="div-counded">
<p>椭圆边框 - border-radius: 15px / 50px:</p>
<p class="corners2">椭圆边框</p>
</div>
<div class="div-counded">
<p>椭圆边框 - border-radius: 50%:</p>
<p class="corners3">椭圆边框</p>
</div>
</div>
</body>
</html>
运行效果:
评论