简体   繁体   English

如何在CSS中勾画圆圈

[英]How do I make an outline of a circle in CSS

How can I create an outline of a circle using CSS, just having the stroke of a circle while the inside of the circle is empty? 如何使用CSS创建圆的轮廓,只是在圆的内部是空的时候有一个圆的笔划?

I tried border but it doesnt display in chrome just firefox. 我试过边框,但它没有在chrome只显示firefox。
I tried: 我试过了:

box-shadow: 0 0 0 0.15em #000;

which looks great on chrome, but in firefox it looks uneven jagged . 它在chrome上看起来很棒,但在firefox中它看起来不均匀锯齿状
Does anyone have any suggestions? 有没有人有什么建议?
This is for circles used for check/filling in. 这是用于检查/填写的圆圈。

It looks like a FireFox issue... 它看起来像FireFox问题......

A way around would be to show the shadow inside the circle, instead of outside. 一种方法是在圆圈内显示shadow ,而不是在外面。

box-shadow: inset 0 0 0 0.15em #000;

Try this: 尝试这个:

.circle {
  border: 1px black solid;
  border-radius: 50px;
  height: 50px;
  width: 50px;
  background-color: white;
}

It should work on chrome, especially doing it this way. 它应该适用于chrome,特别是这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM