如何优化Safari的CSS样式

问题描述 投票:0回答:1

我在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 css3 safari
1个回答
0
投票

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>
© www.soinside.com 2019 - 2024. All rights reserved.