用CSS border-radius画圆的方法

时间:2021-04-16

  1.CSS画实心圆

  长度和宽度相等,border-radius设置为长度(宽度)的一半。

#circle {
width: 200px;
height: 200px;
background-color: #a72525;
-webkit-border-radius: 100px;
}

  2.CSS画空心圆

  和画实心圆方法类似,只是将border大小设置为小于长度(宽度)的一半。

#circle {
width: 200px;
height: 200px;
background-color: #efefef; /* Can be set to transparent */
border: 3px #a72525 solid;
-webkit-border-radius: 100px;
}

  3.CSS画虚线圆

#circle {
width: 200px;
height: 200px;
background-color: #efefef; /* Can be set to transparent */
border: 3px #a72525 dashed;
-webkit-border-radius: 100px 100px 100px 100px;
}

  4.CSS画(左)半圆

#quartercircle {
width: 100px;
height: 200px;
background-color: #a72525;
-webkit-border-radius: 200px 0 0 200px;
}

  5.CSS画1/4圆

#quartercircle {
width: 200px;
height: 200px;
background-color: #a72525;
-webkit-border-radius: 200px 0 0 0;
}

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章