Html 如何设置背景图像不透明度的动画?
我试图在标题上做一点动画,我使用粉红色的红线,我想消失并出现在关键帧上,但是当我应用我的样式时,所有容器都是动画(两个框),我只想在粉红色的线上应用这个动画。我的代码如下: HTML 我如何才能仅将AOCapacity应用于我的粉色线条?试试以下方法:Html 如何设置背景图像不透明度的动画?,html,css,bootstrap-4,Html,Css,Bootstrap 4,我试图在标题上做一点动画,我使用粉红色的红线,我想消失并出现在关键帧上,但是当我应用我的样式时,所有容器都是动画(两个框),我只想在粉红色的线上应用这个动画。我的代码如下: HTML 我如何才能仅将AOCapacity应用于我的粉色线条?试试以下方法: #header { position: relative; height: 100vh; } #header:after { content : ""; di
#header {
position: relative;
height: 100vh;
}
#header:after {
content : "";
display: block;
position: absolute;
top: 0;
left: 0;
background-image: url('../img/header/0.png');
width: 100%;
height: 100%;
opacity : 1;
z-index: -1;
-webkit-animation: changeBg 5s infinite;
animation: changeBg 5s infinite;
animation-direction: alternate;
background-repeat: no-repeat;
background-position: right bottom;
animation-duration: 5s;
animation-name: base-lines;
animation-iteration-count: infinite;
}
@keyframes changeBg {
0% {opacity: 0.00;}
100% {opacity: 1.00;}
}
你的行的图像是什么?0.png(CSS背景)你能给我你的页面链接吗?我很想看看这门课的结果如何,现在我正在发展,但你会发现:我有很多工作要做,但我对头球很满意。再次感谢!:)你的页面很好!
/* Esperimental header */
.section-1 {
background-color: #1b154e;
}
#header {
/* position: relative; */
height: 100vh;
background-image: url('../img/header/0.png');
background-repeat: no-repeat;
background-position: right bottom;
/* background-size: contain; */
animation-duration: 5s;
animation-name: base-lines;
animation-iteration-count: infinite;
}
#header img {
/* position: absolute; */
right: 0;
bottom: 12%;
}
#header {
position: relative;
height: 100vh;
}
#header:after {
content : "";
display: block;
position: absolute;
top: 0;
left: 0;
background-image: url('../img/header/0.png');
width: 100%;
height: 100%;
opacity : 1;
z-index: -1;
-webkit-animation: changeBg 5s infinite;
animation: changeBg 5s infinite;
animation-direction: alternate;
background-repeat: no-repeat;
background-position: right bottom;
animation-duration: 5s;
animation-name: base-lines;
animation-iteration-count: infinite;
}
@keyframes changeBg {
0% {opacity: 0.00;}
100% {opacity: 1.00;}
}