使用css3画出各种各样的椭圆的原理
我们需要使用css3中的border-radius属性,修改width值为200px,然后把border-radius改成100px/50px;“/”之前的是水平半径,”/”之后的是垂直半径,所以100px/50px就让div成了椭圆border-radius:100px/50px;
我们既然需要使用css3中的border-radius属性,那么今天我们将带大家详细了解一下border-radius属性。
border-radius属性
含义:border-radius属性简写属性为元素添加圆角边框。
语法:border-radius:1-4length|%/1-4length|%;
浏览器兼容性:IE9+、Firefox4+、Chrome、Safari5+以及Opera支持border-radius属性。
使用css3画出各种各样的椭圆的代码
<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<style>
#rcorners1{
border-radius:50px/15px;
background:#8AC007;
padding:20px;
width:200px;
height:150px;
}
#rcorners2{
border-radius:15px/50px;
background:#8AC007;
padding:20px;
width:200px;
height:150px;
}
#rcorners3{
border-radius:50%;
background:#8AC007;
padding:20px;
width:200px;
height:150px;
}
</style>
</head>
<body>


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