虚线边框不显示在Firefox中

问题描述:

我有一个半径div与5px虚线边框,但边框在 Firefox 中无法正确显示。
在IE和chrome中显示效果良好。

I have a radius div with 5px dashed border, but border not show properly in Firefox. It show well in IE and chrome.

演示

 div{
        height:100px;
        width: 100px;
        background-color: #ccc;
        border-radius: 50%;
        border:5px dashed #333;
    }


请参阅 DEMO ,您可以通过删除半径来检查它。

Your border is working on firefox see DEMO you can check it with removing radius. FireFox having bug when you tried circle with dashed border.

这是一个已知错误。您的选项是:

This is a known bug. Your options are:


  • 如果这只是为了圆圈,请使用< canvas& ,例如如此处所示。

  • 使用SVG(可能是内联),它支持各种方式笔触路径

  • 只需创建一个图片PNG

  • 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
  • Just make a Image PNG