• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

css3 animation problem

bengaltiger

Neues Mitglied
hallo

ich versuche folgendes:
ein rechteck soll eine animierte bewegung nach unten machen und da einfach stehen bleiben
doch mit den folgen den code kommt der immer wieder am ende hoch..

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css"> 
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:myfirst 5s linear;
/* Firefox: */
-moz-animation:myfirst 5s linear;
/* Safari and Chrome: */
-webkit-animation:myfirst 5s linear;
}

@keyframes myfirst
{
0%   {background:red; left:0px; top:0px;}
100% {background:red; left:0px; top:200px;}
}

@-moz-keyframes myfirst /* Firefox */
{
0%   {background:red; left:0px; top:0px;}
100% {background:red; left:0px; top:200px;}
}

@-webkit-keyframes myfirst /*Safari and Chrome */
{
0%   {background:red; left:0px; top:0px;}
100% {background:red; left:0px; top:200px;}
}
</style>
</head>
<body>

<div></div>

</body>
</html>

ich hoffe ihr könnt helfen :D
 
Probier mal in div{} noch top:200px zu ergänzen. Müsste funktionieren, aber ich weiß nich, wie das dann beim laden aussieht (ob das div erst kurze Zeit unten angezeigt wird und dann nach oben springt, oder ob es gleich oben angezeigt wird)
 
Zurück
Oben