先实现个简单点的,用css实现一个圆,ok,直接上代码:css
.circle{ width: 100px; height:100px; background: red; border-radius: 50%; }
.circle{ width: 100px; height:100px; background: red; border-radius: 50%; transform: scale(1,0.5); }
效果以下
html
.circle{ width: 100px; height:50px; background: red; border-radius: 50%; }
效果以下
css3
.circle{ width: 100px; height:100px; background: red; border-top-left-radius:100px 50px; border-top-right-radius:100px 50px; border-bottom-left-radius:100px 50px; border-bottom-right-radius:100px 50px; }
效果以下
可是这样实现的效果还不是椭圆,还要再把高度设置为宽度的一半,因此仍是直接用第二种方法比较简便wordpress