html - 可以在 Chrome 中精美再现的 CSS 在 Firefox 中很脏
问题描述
在应用以下 CSS Chrome 和 Chromium 衍生浏览器(包括 OPERA)时,可以很好地反映菱形图案,但如果将其应用到 Firefox 及其衍生浏览器,它会显得很脏。
如果您想在 Firefox 中重现漂亮的菱形图案等,您该如何解决?
实际插入 CSS 的页面 https://www.yahoo.co.jp/
/* Base element */
body{
background-color: #ff3838e3;
color: #0d0d0d;
filter: sepia(30%);
zoom: 95.5%;}
*:not(.barGraph){
font-family: "Meiryo", sans-serif !important;
font-size: 16px;
border-width: 0.1px !important;
border-radius: 10px;
}
/* Code for problems with Firefox and Firefox-derived browsers ↓ */
div#wrapper._1DyDVN-3FsqGF_QKLg1M9G{
background-color: #ff151500;
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #ffe5e545), color-stop(.25, transparent), to(transparent)),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, #ffe5e545), color-stop(.25, transparent), to(transparent)),
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, #ffe5e545)),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, #ffe5e545));
-webkit-background-size:200px 200px;
}
我尽量把它保持在最低限度,进一步刮掉上面的“最低要求”代码是:
/* Code for problems with Firefox and Firefox-derived browsers ↓ */
body{
background-color: #ff3838e3;
}
div#wrapper._1DyDVN-3FsqGF_QKLg1M9G{
background-color: #ff151500;
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #ffe5e545), color-stop(.25, transparent), to(transparent)),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, #ffe5e545), color-stop(.25, transparent), to(transparent)),
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, #ffe5e545)),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, #ffe5e545));
-webkit-background-size:200px 200px;
}
解决方案
推荐阅读
- flutter - 'showSnackBar' 已弃用,不应使用
- python - 如何将抓取的元素放入一个列表 BeautifulSoup?
- python - Selenium 与 Python:消息:元素
- javascript - 复制浏览器 URL 栏的特定部分
- regex - 如何使用正则表达式从 vscode 用户片段中的 TM_FILEPATH 返回目录?
- compiler-construction - 证明不是 LALR(1) 的 LR(1) 文法必须只有 reduce/reduce 冲突
- ghost-blog - 如何在子目录上制作幽灵主页?
- c# - 为什么我在此代码的循环中出现错误?
- java - 从现有变量创建映射(例如,Java 等价于 JavaScript 的 `{varA, varB, varC}`)
- html - 在模板中动态加载背景图片