Looking to add animation to two paragraphs with text in them? Want the first paragraph to move from left on the x-axis, and the second paragraph from right to left?
If your code is only working for one direction (left or right), here's a possible solution:
<!DOCTYPE html>
<html>
<head>
<style>
#text {
position:relative;
-webkit-animation: mymove infinite; /* Chrome, Safari, Opera */
-webkit-animation-duration: 2s; /* Chrome, Safari, Opera */
animation: mymove infinite;
animation-duration: 2s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes mymove {
from {top: 200px;}
to {top: 0px;}
}
@keyframes mymove {
from {top: 0px;}
to {top: 100px;}
}
#text1 {
position:relative;
-webkit-animation: mymove1 infinite; /* Chrome, Safari, Opera */
-webkit-animation-duration: 2s; /* Chrome, Safari, Opera */
animation: mymove1 infinite;
animation-duration: 2s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes mymove1 {
from {right: -200px;}
to {right: 0px;}
}
@keyframes mymove1 {
from {top: 0px;}
to {top: 100px;}
}
</style>
</head>
<body>
<p id="text">Some text goes here</p>
<p id="text1">text display animation</p>
</body>
</html>
This should animate the second paragraph from right to left and the first one from left to right. Try it out and see if it works!