How do I create a circle or square with just CSS - with a hollow center?

后端 未结 8 2617
南旧
南旧 2020-12-13 08:47

It should just basically be an outline of the square or circle - that I can style accordingly (i.e. change the color to whatever I want, change the thickness of the border,

8条回答
  •  星月不相逢
    2020-12-13 09:12

    Try This

    div.circle {
      -moz-border-radius: 50px/50px;
      -webkit-border-radius: 50px 50px;
      border-radius: 50px/50px;
      border: solid 21px #f00;
      width: 50px;
      height: 50px;
    }
    
    div.square {
      border: solid 21px #f0f;
      width: 50px;
      height: 50px;
    }

    More here

提交回复
热议问题