我在一个网站上工作,其中主页的一部分在 Safari 和 Chrome 中显示不同。
在 Chrome 上,我可以看到代码使用 before & after 伪元素进行样式设置,使用以下代码:
.home-about:before {
content: "";
background: #efebe8;
height: 100%;
position: absolute;
left: 0;
width: 50%;
top: 0;
}
.home-about:after {
content: "";
background: rgb(255 255 255 / 70%);
height: 100%;
position: absolute;
right: 0;
width: 50%;
top: 0;
z-index: 0;
}
这在 Chrome 上工作正常,但在 Safari 上不行。不幸的是,我在 Windows 上,似乎找不到任何选项来下载 Safari 来自己解决这个问题。有谁知道可能导致代码无法在 Safari 中运行的原因?