CodePen - 只有Safari上的问题
HTML
<div id="background"></div>
<div class="text">
This is some sample text that doesn't look great.
</div>
<div class="text text-background">
This is some sample text that looks stellar!
</div>
CSS
#background {
background-image: url("https://s3-us-west-2.amazonaws.com/ks.test/beaver_creek.jpg");
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.text {
color: white;
font-family: "Lato";
font-size: 20px;
font-weight: 300;
position: relative;
}
.text-background {
background-color: #464646;
height: 50px;
line-height: 50px;
margin-top: 10px;
}
我发现了很多相关的帖子(例如here),但没有一个直接解决问题,因为背景图片似乎是罪魁祸首。
只有在Safari中,我遇到的问题是字体渲染背景图像效果不佳,但当我删除背景图像并将其设置为灰色时,字体看起来很好。