javascript - CSS边框在chrome和firefox中呈现不同
问题描述
当我使用相似的边框宽度和元素宽度时,CSS 虚线边框不会在 Firefox 上显示。看起来firefox在边框之前添加了一些偏移量。知道如何解决吗?
这是示例:
<h3>width: 90px (works fine)</h3>
<div style="width: 90px; background: yellow">
<div style="border-top: 20px dotted red"></div>
</div>
<h3>width: 20px (border not showing on firefox)</h3>
<div style="width: 20px; background: yellow">
<div style="border-top: 20px dotted red"></div>
</div>
解决方案
而是使用径向渐变:-
.circle-with-yellow {
background-position: 0 0;
background-size: 20px 20px;
background-image: radial-gradient(red 50%, yellow 10%);
height: 20px;
}
推荐阅读
- arrays - 是否有必要在类中使用复制以避免覆盖以前的变量?
- python - UnsupportedOperation:不可写
- jpa - 如何在 JPA 左连接中的右表上应用子句
- hadoop - Hive:有条件地截断并加载表
- python - 根据列表列表中的计数在列表列表中重复值
- ios - Firebase更改显示在谷歌登录警报上的应用名称?
- shell - 终端:cp -r -u 命令不会递归地将文件夹内容复制到另一个文件夹
- node.js - Angular 6 - 如何在每个请求中维护 jwt 会话?
- oracle - 如何更改 apex oracle 中的表单图标?
- java - 使用 java.util.zip 写入大小