cssで正円の書き方

投稿日:

仕事中ですが自己メモってことで・・

.itembox {position: relative; width: 100%;}
.itembox:before {content:””; display: block; padding-top: 100%; /* 高さを幅の100%に固定 */}
.circle{position: absolute; top: 0; left: 0; bottom: 0; right: 0;}
ここまでで正方形。
正円にするには border-radius:50%; もつけてね。