我注意到在 div 上应用虚线边框以及
border-radius
会导致 "dashed" 长度错误。请查看下面的图像,在角附近出现问题,该问题仅在 Firefox 44 和 46 上出现,并且在 Chrome 49 上看起来很好。
看起来是FF中的一个bug。我知道在FF上border-radius存在问题,但我想知道是否有解决方法。
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#target {
width: 300px;
height: 300px;
background-color: red;
border: 10px dashed purple;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
}
<div id="target"></div>