带有虚线或虚线边框的圆圈

时间:2023-02-10 00:17:19

I'm wonder if there is a way to create a circle (fully cornered element) with dotted or dashed border using CSS. I do that with border: 1px dotted #000; and border radius border-radius: 100px;, but the result is something unexpected. See the result in http://jsfiddle.net/7jV8y/

我想知道是否有办法使用CSS创建一个带有虚线或虚线边框的圆圈(完全角落的元素)。我用边框做到这一点:1px点缀#000;和边界半径border-radius:100px;,但结果是意外的。在http://jsfiddle.net/7jV8y/中查看结果

I see a circle with solid border and seems that's because of corners. Do you know any solution ?

我看到一个带有实心边框的圆圈,似乎是因为角落。你知道任何解决方案吗?

1 个解决方案

#1


10  

If you're using Firefox, this is a known bug. Your options are:

如果您使用的是Firefox,这是一个已知错误。你的选择是:

  • If this is just for the sake of a circle, draw it with <canvas>, e.g. as demonstrated here
  • 如果这只是为了一个圆圈,用 绘制它,例如如此处所示
  • Use SVG (possibly inline), which supports various ways to stroke paths
  • 使用SVG(可能是内联),它支持各种方式来描边路径
  • Just make a PNG
  • 只需制作一个PNG
  • Fix the bug, which Mozilla will surely appreciate ;)
  • 修复错误,Mozilla肯定会欣赏;)

#1


10  

If you're using Firefox, this is a known bug. Your options are:

如果您使用的是Firefox,这是一个已知错误。你的选择是:

  • If this is just for the sake of a circle, draw it with <canvas>, e.g. as demonstrated here
  • 如果这只是为了一个圆圈,用 绘制它,例如如此处所示
  • Use SVG (possibly inline), which supports various ways to stroke paths
  • 使用SVG(可能是内联),它支持各种方式来描边路径
  • Just make a PNG
  • 只需制作一个PNG
  • Fix the bug, which Mozilla will surely appreciate ;)
  • 修复错误,Mozilla肯定会欣赏;)