您的位置:首页 > Web前端 > CSS

用CSS来画圆

2015-10-07 21:40 666 查看
.circle {
border-radius: 50%;
width: 200px;
height: 200px;
/* 宽度和高度需要相等 */
}

/* 动画定义 */
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

/* 旋转,渐变色 */
#advanced {
width: 200px;
height: 200px;

background-image: -moz-radial-gradient(45px 45px 45deg, circle cover, yellow 0%, orange 100%, red 95%);
background-image: -webkit-radial-gradient(45px 45px, circle cover, yellow, orange);
background-image: radial-gradient(45px 45px 45deg, circle cover, yellow 0%, orange 100%, red 95%);

animation-name: spin;
animation-duration: 3s; /* 3 seconds */
animation-iteration-count: infinite;
animation-timing-function: linear;
}


div{border-radius:5px} 
设置DIV对象盒子四个角5像素圆角效果

div{border-radius:5px 0;} 
设置DIV对象盒子左上角和右下角5px圆角,其它两个角为0不圆角

div{border-radius:5px 5px 0 0;} 
设置DIV对象盒子左上角和右上角5px圆角,其它两个角为0不圆角
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: