Animation mit Text CSS?
Hallo,
Ich habe folgenden code:
div {
width: 100px;
height: 100px;
background-color: black;
animation-name: beispiel;
animation-duration: 5s;
}
@keyframes beispiel {
0% {width: 100px; background-color: black;}
20% {width: 200px; background-color: darkred;}
40% {width: 500px; background-color: darkcyan;}
60% {width: 200px; background-color: darkblue;}
80% {width: 100px; background-color: darkred;}
100% {width: 50px; background-color: black;}
}
ICH MÖCHTE DEN TEXT IN DEN CONTAINER PACKEN SO DAS DIESER SICH IN DER ANIMATION IM CONTAINER BEFINDET:
ICH HOFFE IHR VERSTEHT ES
LG
1 Antwort
Von gutefrage auf Grund seines Wissens auf einem Fachgebiet ausgezeichneter Nutzer
HTML, CSS, Programmieren & Softwareentwicklung
ICH MÖCHTE DEN TEXT IN DEN CONTAINER PACKEN
dann mach das doch.
<style>
div {
width: 100px;
height: 100px;
background-color: black;
animation-name: beispiel;
animation-duration: 5s;
color:white
}
@keyframes beispiel {
0% {width: 100px; background-color: black};
20% {width: 200px; background-color: darkred};
40% {width: 500px; background-color: darkcyan;}
60% {width: 200px; background-color: darkblue;}
80% {width: 100px; background-color: darkred;}
100% {width: 50px; background-color: black;}
}
</style>
<div>hello world</div>
Alex