編碼的世界 / 優質文選 / 生涯

用純css做一個圓


2021年10月01日
-   

HTML
<div class="circle"></div>

 css
.circle {
border-radius: 50%;
width: 2rem;
height: 2rem;
background: #333;
}


注意 width和height必須相同,如果不同就變成橢圓了。

熱門文章