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

后端 未结 8 2501
南旧
南旧 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:21

    To my knowledge there is no cross-browser compatible way to make a circle with CSS & HTML only.

    For the square I guess you could make a div with a border and a z-index higher than what you are putting it over. I don't understand why you would need to do this, when you could just put a border on the image or "something" itself.

    If anyone else knows how to make a circle that is cross browser compatible with CSS & HTML only, I would love to hear about it!

    @Caspar Kleijne border-radius does not work in IE8 or below, not sure about 9.

提交回复
热议问题