gpt4 book ai didi

css - 我的风格在 Chrome 中完美运行,但在 Firefox 中不完美

转载 作者:行者123 更新时间:2023-11-28 16:50:26 25 4
gpt4 key购买 nike

我为闪烁文本阴影编写了简单的 css。

它在谷歌浏览器中正常工作。

但不适用于 firefox。

我需要在所有类型的浏览器中工作。

谁能帮帮我

#container {
width: 500px;
margin: auto;
}
#container {
width: 500px;
margin: auto;
}
p {
text-align: center;
font-size: 2em;
margin: 20px 0 20px 0;
}
a {
text-decoration: none;
-webkit-transition: all 0.5s;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
p:nth-child(1) a {
color: #316885;
font-family: Monoton;
-webkit-animation: neon1 1.5s ease-in-out infinite alternate;
-webkit-animation: neon1 1.5s ease-in-out infinite alternate;
animation: neon1 1.5s ease-in-out infinite alternate;
}
p:nth-child(1) a:hover {
color: #316885;
-webki t-animation: none;
-webkit-animation: none;
animation: none;
}
@-webkit-keyframes neon1 {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #6C7376, 0 0 70px #6C7376, 0 0 80px #6C7376, 0 0 100px #6C7376, 0 0 150px #6C7376;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #6C7376, 0 0 35px #6C7376, 0 0 40px #6C7376, 0 0 50px #6C7376, 0 0 75px #6C7376;
}
}
<html>

<head>
<style>
</style>
</head>

<body>
<div id="container">
<p>
<a class="changeColor">Daily Mail Dispathch Service-Sri Lanka Army</a>

</p>
</div>
</body>

</html>

最佳答案

你还需要定义@keyframes对于火狐。您当前的代码仅针对 webkit 浏览器,因此适用于 Chrome。

@keyframes neon1 {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #6C7376, 0 0 70px #6C7376, 0 0 80px #6C7376, 0 0 100px #6C7376, 0 0 150px #6C7376;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #6C7376, 0 0 35px #6C7376, 0 0 40px #6C7376, 0 0 50px #6C7376, 0 0 75px #6C7376;
}
}

输出:

#container {
width: 500px;
margin: auto;
}
#container {
width: 500px;
margin: auto;
}
p {
text-align: center;
font-size: 2em;
margin: 20px 0 20px 0;
}
a {
text-decoration: none;
-webkit-transition: all 0.5s;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
p:nth-child(1) a {
color: #316885;
font-family: Monoton;
-webkit-animation: neon1 1.5s ease-in-out infinite alternate;
-webkit-animation: neon1 1.5s ease-in-out infinite alternate;
animation: neon1 1.5s ease-in-out infinite alternate;
}
p:nth-child(1) a:hover {
color: #316885;
-webkit-animation: none;
-webkit-animation: none;
animation: none;
}
@-webkit-keyframes neon1 {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #6C7376, 0 0 70px #6C7376, 0 0 80px #6C7376, 0 0 100px #6C7376, 0 0 150px #6C7376;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #6C7376, 0 0 35px #6C7376, 0 0 40px #6C7376, 0 0 50px #6C7376, 0 0 75px #6C7376;
}
}
@keyframes neon1 {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #6C7376, 0 0 70px #6C7376, 0 0 80px #6C7376, 0 0 100px #6C7376, 0 0 150px #6C7376;
}
to {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #6C7376, 0 0 35px #6C7376, 0 0 40px #6C7376, 0 0 50px #6C7376, 0 0 75px #6C7376;
}
}
<div id="container">
<p>
<a class="changeColor">Daily Mail Dispathch Service-Sri Lanka Army</a>
</p>
</div>

关于css - 我的风格在 Chrome 中完美运行,但在 Firefox 中不完美,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32712901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com