+ 2
Animation with the text
How to make @keyframes where changes the background and the text written in html as well?
4 Antworten
+ 16
@keyframes chng {
from {
background:red;
content:"red"
}
to {
background:blue;
content:blue
}
}
//not working on mobiles....
+ 3
Animation with changing text and color:
in HTML:
<h1></h1>
in CSS:
#h1:before {
content: "RED";
animation: chg 5s linear 0s infinite alternate;
}
@keyframes chg {
from {
color: red;
content: "RED";
opacity: 1}
50% {
opacity: 0;
}
to {
color: blue;
content: "BLUE";
opacity: 1;};
}
// Please note that the CSS content property can only be used with :before and :after pseudo-elements
https://code.sololearn.com/WK2Uaf2mUl03/?ref=app
0
Thank you👍
0
@ValentinHacker
Why it doesn't work on mobiles???