如何优化 Safari 的 css 样式



我在 Safari 上正确显示 css3 样式时遇到了问题。这是我的代码的链接:https://codepen.io/VictorHub/pen/NmYOGj 图像上有透明的笔划文本。一切正常,但在Safari浏览器中不行(字母中出现黑色背景(。当然,我们谈论的是最新版本的Safari浏览器。请帮我解决这个问题。由于我没有macos,情况变得复杂。

html {
  background: #fff;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: url('https://medievaltorturemuseum.com/wp-content/uploads/2018/02/slide3-1.jpg')
}
.text-wrap {
  mix-blend-mode: screen;
  position: absolute;
}
.text {
  text-align: center;
    font-weight: 700;
    color: rgb(12, 12, 12);
  font-size: 98px;
      background: -webkit-linear-gradient(top, rgba(170,26,24,1) 0%, rgba(213,44,50,1) 39%, rgba(236,97,94,1) 45%, rgba(202,34,34,1) 69%, rgba(148,36,43,1) 100%);
    -webkit-background-clip: text;
    -webkit-text-stroke: 4px transparent;
    letter-spacing: -4px;
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
    animation-name: blink2;
    animation-duration: 150ms;
    animation-iteration-count: infinite;
    animation-direction: alternate;
  -webkit-font-smoothing: antialiased !important;
}
@keyframes blink2 {
0% {
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
}
  
  100% {
    text-shadow: 0px 0px 20px rgba(208,34,40,0.75);
  }
}
<div class="text-wrap">
  <div class="text">ARE YOU BRAVE<br/>ENOUGH ?</div>
</div>

html {
  background: #fff;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: url('https://medievaltorturemuseum.com/wp-content/uploads/2018/02/slide3-1.jpg')
}
.text-wrap {
  mix-blend-mode: screen;
  position: absolute;
}
.text {
  text-align: center;
    font-weight: 700;
    color: rgb(12, 12, 12);
  font-size: 98px;
      background: -webkit-linear-gradient(top, rgba(170,26,24,1) 0%, rgba(213,44,50,1) 39%, rgba(236,97,94,1) 45%, rgba(202,34,34,1) 69%, rgba(148,36,43,1) 100%);
    -webkit-background-clip: text;
    -webkit-text-stroke: 4px transparent;
    letter-spacing: -4px;
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
    animation-name: blink2;
    animation-duration: 150ms;
    animation-iteration-count: infinite;
    animation-direction: alternate;
  -webkit-font-smoothing: antialiased !important;
}
@keyframes blink2 {
0% {
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
}
  
  100% {
    text-shadow: 0px 0px 20px rgba(208,34,40,0.75);
  }
}
@-webkit-keyframes blink2 {
0% {
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
}
  
  100% {
    text-shadow: 0px 0px 20px rgba(208,34,40,0.75);
  }
}
@-moz-keyframes blink2 {
0% {
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
}
  
  100% {
    text-shadow: 0px 0px 20px rgba(208,34,40,0.75);
  }
}
@-o-keyframes blink2 {
0% {
    text-shadow: 0px 0px 20px rgba(208,34,40,1);
}
  
  100% {
    text-shadow: 0px 0px 20px rgba(208,34,40,0.75);
  }
}
<div class="text-wrap">
  <div class="text">ARE YOU BRAVE<br/>ENOUGH ?</div>
</div>

最新更新