Safari Text-shadow重复文本

发布于 2025-02-09 17:50:09 字数 418 浏览 1 评论 0原文

我有一个奇怪的问题,在使用Safari中的文字阴影时,我的字体在彼此下方显示了2次。 (用于H2标签)

我尝试了其他一些帖子的解决方案,例如将颜色交换为第一个参数,然后是尺寸,但这无济于事。

这是我的CSS:

h2 {
    font-family: "sauna-bold", sans-serif;
    text-shadow: 2px 2px 2px #555;
}

这是我的文本显示方式的屏幕截图:

I have a weird problem, where my font gets displayed 2 times below eachother when using text-shadow in safari. (Used for h2 tags)

I tried the solutions of some other posts, like swapping the color as first argument and then the dimensions, but that didnt help.

This is my CSS:

h2 {
    font-family: "sauna-bold", sans-serif;
    text-shadow: 2px 2px 2px #555;
}

Here is an Screenshoot on how my text is displayed:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意犹 2025-02-16 17:50:09

您可以尝试CSS前缀。这是使您的样式与浏览器兼容的。还有更多详细信息,以及 prefix

  h2 {
      -webkit-text-shadow: 2px 2px 2px #555;
      -moz-text-shadow: 2px 2px 2px #555;
      -ms-text-shadow: 2px 2px 2px #555;
      -o-text-shadow: 2px 2px 2px #555;
      text-shadow: 2px 2px 2px #555;
   }

you can try css prefix. which is responsible to make your style compatible with the browser. here's more detail for it as well prefix

  h2 {
      -webkit-text-shadow: 2px 2px 2px #555;
      -moz-text-shadow: 2px 2px 2px #555;
      -ms-text-shadow: 2px 2px 2px #555;
      -o-text-shadow: 2px 2px 2px #555;
      text-shadow: 2px 2px 2px #555;
   }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文