我想要一个有 30% 黑色和 70% 透明的渐变,它必须在我容器的渐变之上并且在我的 ul 之下
我想要这个黑色渐变覆盖我的动画渐变和我的 ul。所以,这个渐变必须在我的 ul 下产生模糊效果,所以它主要覆盖我的白色文本,而且它必须是 90 deg
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-weight: 700;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.container {
display: grid;
grid-template-columns: 2fr 8fr;
background: linear- gradient(45deg, rgb(0, 0, 255), rgb(150, 150, 255), rgb(255, 150, 150), rgb(255, 0, 0));
width: 100%;
height: 100vh;
background-size: 300% 300%;
animation: color 12s ease-in-out infinite;
}
@keyframes color {
0% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0 50%;
}
}
li a {
color: white;
text-decoration: none;
font-size: 4rem;
position: relative;
display: inline-block;
}
ul:hover li a {
filter: blur(2px);
color: rgb(192, 192, 192);
}
ul li a:hover {
filter: blur(0);
color: white;
font-size: 4.2rem;
animation: revealtext 3s;
}
@keyframes revealtext {
0% {
transform: translateX(0);
}
50% {
transform: translateX(30px);
}
100% {
transform: translateX(0);
}
}
ul {
overflow: hidden;
}
ul li a::before {
position: absolute;
content: '';
bottom: .1em;
left: 0;
height: 1px;
border-bottom: 3px solid white;
width: 100%;
transform: translateX(-107%);
transition: transform 2s;
}
li:hover a:before {
transform: translateX(0);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="container">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</body>
</html>