CSS border-radius畫圓

來源:互聯網
上載者:User

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;}

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.