How does this CSS produce a circle?

前端 未结 5 2142
鱼传尺愫
鱼传尺愫 2020-11-28 00:30

This is the CSS:

div {
    width: 0;
    height: 0;
    border: 180px solid red;
    border-radius: 180px;
}

How does it produce the circle

5条回答
  •  时光取名叫无心
    2020-11-28 01:15

    I think that it initially creates rectangle with height and width = 180px and then make curve with given radius like 30px with each corner. So it sets border with given radius.

提交回复
热议问题