Timing animation on CSS [duplicate]
This question already has an answer here:
Looping Animation of text color change using CSS3
2 answers
There are 4 text and 8 pictures. One text relate to 2 pictures. The text should change color to red as soon as the picture has changed and remain during 2 pictures and then change color to black again. As soon as 3 picture appears text color is red again until 4 picture etc. I have a problem with timing. How can I set the time in my code?
@keyframes fadeIm-1
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-2
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-3
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-4
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
@keyframes fadeIm-5
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-6
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-7
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-8
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
.div-style
{
position: relative;
text-align: center;
width: 99%;
}
.img-style
{
width: 33.3%;
margin-top: 8px;
border: 1px solid #0000ff;
animation-duration: 24s;
animation-iteration-count: infinite;
}
.img-style.next
{
position: absolute;
left: 33.3%;
opacity: 0;
}
.img-style.im-1
{
animation-name: fadeIm-1;
}
.img-style.next.im-2
{
animation-name: fadeIm-2;
}
.img-style.next.im-3
{
animation-name: fadeIm-3;
}
.img-style.next.im-4
{
animation-name: fadeIm-4;
}
.img-style.next.im-5
{
animation-name: fadeIm-5;
}
.img-style.next.im-6
{
animation-name: fadeIm-6;
}
.img-style.next.im-7
{
animation-name: fadeIm-7;
}
.img-style.next.im-8
{
animation-name: fadeIm-8;
}
p{
-webkit-animation: color-change 1s infinite;
-moz-animation: color-change 1s infinite;
-o-animation: color-change 1s infinite;
-ms-animation: color-change 1s infinite;
animation: color-change 1s infinite;
}
@-webkit-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-moz-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-ms-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-o-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
this is html:
<p>Text1</p>
<p>Text2</p>
<p>Text3</p>
<p>Text4</p>
<div class="div-style">
<img src="img/1.png" title="Image 1" class="img-style im-1">
<img src="img/5.png" title="Image 2" class="img-style next im-2">
<img src="img/8.png" title="Image 3" class="img-style next im-3">
<img src="img/9.png" title="Image 4" class="img-style next im-4">
<img src="img/11.png" title="Image 4" class="img-style next im-5">
<img src="img/16.png" title="Image 4" class="img-style next im-6">
<img src="img/5.png" title="Image 4" class="img-style next im-7">
<img src="img/8.png" title="Image 4" class="img-style next im-8">
</div>
html css
marked as duplicate by Yvette Colomb♦ Dec 2 '18 at 2:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Looping Animation of text color change using CSS3
2 answers
There are 4 text and 8 pictures. One text relate to 2 pictures. The text should change color to red as soon as the picture has changed and remain during 2 pictures and then change color to black again. As soon as 3 picture appears text color is red again until 4 picture etc. I have a problem with timing. How can I set the time in my code?
@keyframes fadeIm-1
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-2
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-3
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-4
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
@keyframes fadeIm-5
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-6
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-7
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-8
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
.div-style
{
position: relative;
text-align: center;
width: 99%;
}
.img-style
{
width: 33.3%;
margin-top: 8px;
border: 1px solid #0000ff;
animation-duration: 24s;
animation-iteration-count: infinite;
}
.img-style.next
{
position: absolute;
left: 33.3%;
opacity: 0;
}
.img-style.im-1
{
animation-name: fadeIm-1;
}
.img-style.next.im-2
{
animation-name: fadeIm-2;
}
.img-style.next.im-3
{
animation-name: fadeIm-3;
}
.img-style.next.im-4
{
animation-name: fadeIm-4;
}
.img-style.next.im-5
{
animation-name: fadeIm-5;
}
.img-style.next.im-6
{
animation-name: fadeIm-6;
}
.img-style.next.im-7
{
animation-name: fadeIm-7;
}
.img-style.next.im-8
{
animation-name: fadeIm-8;
}
p{
-webkit-animation: color-change 1s infinite;
-moz-animation: color-change 1s infinite;
-o-animation: color-change 1s infinite;
-ms-animation: color-change 1s infinite;
animation: color-change 1s infinite;
}
@-webkit-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-moz-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-ms-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-o-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
this is html:
<p>Text1</p>
<p>Text2</p>
<p>Text3</p>
<p>Text4</p>
<div class="div-style">
<img src="img/1.png" title="Image 1" class="img-style im-1">
<img src="img/5.png" title="Image 2" class="img-style next im-2">
<img src="img/8.png" title="Image 3" class="img-style next im-3">
<img src="img/9.png" title="Image 4" class="img-style next im-4">
<img src="img/11.png" title="Image 4" class="img-style next im-5">
<img src="img/16.png" title="Image 4" class="img-style next im-6">
<img src="img/5.png" title="Image 4" class="img-style next im-7">
<img src="img/8.png" title="Image 4" class="img-style next im-8">
</div>
html css
marked as duplicate by Yvette Colomb♦ Dec 2 '18 at 2:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
animation: color-change 1s infinite;set instead1swhat time you want... or hereanimation-duration: 24s;
– לבני מלכה
Nov 27 '18 at 10:58
@לבנימלכה but this is general animation-duration, I need to set for eachp
– Juicy134
Nov 27 '18 at 11:01
Don't post duplicate questions.
– Yvette Colomb♦
Dec 2 '18 at 2:07
add a comment |
This question already has an answer here:
Looping Animation of text color change using CSS3
2 answers
There are 4 text and 8 pictures. One text relate to 2 pictures. The text should change color to red as soon as the picture has changed and remain during 2 pictures and then change color to black again. As soon as 3 picture appears text color is red again until 4 picture etc. I have a problem with timing. How can I set the time in my code?
@keyframes fadeIm-1
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-2
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-3
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-4
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
@keyframes fadeIm-5
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-6
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-7
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-8
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
.div-style
{
position: relative;
text-align: center;
width: 99%;
}
.img-style
{
width: 33.3%;
margin-top: 8px;
border: 1px solid #0000ff;
animation-duration: 24s;
animation-iteration-count: infinite;
}
.img-style.next
{
position: absolute;
left: 33.3%;
opacity: 0;
}
.img-style.im-1
{
animation-name: fadeIm-1;
}
.img-style.next.im-2
{
animation-name: fadeIm-2;
}
.img-style.next.im-3
{
animation-name: fadeIm-3;
}
.img-style.next.im-4
{
animation-name: fadeIm-4;
}
.img-style.next.im-5
{
animation-name: fadeIm-5;
}
.img-style.next.im-6
{
animation-name: fadeIm-6;
}
.img-style.next.im-7
{
animation-name: fadeIm-7;
}
.img-style.next.im-8
{
animation-name: fadeIm-8;
}
p{
-webkit-animation: color-change 1s infinite;
-moz-animation: color-change 1s infinite;
-o-animation: color-change 1s infinite;
-ms-animation: color-change 1s infinite;
animation: color-change 1s infinite;
}
@-webkit-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-moz-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-ms-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-o-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
this is html:
<p>Text1</p>
<p>Text2</p>
<p>Text3</p>
<p>Text4</p>
<div class="div-style">
<img src="img/1.png" title="Image 1" class="img-style im-1">
<img src="img/5.png" title="Image 2" class="img-style next im-2">
<img src="img/8.png" title="Image 3" class="img-style next im-3">
<img src="img/9.png" title="Image 4" class="img-style next im-4">
<img src="img/11.png" title="Image 4" class="img-style next im-5">
<img src="img/16.png" title="Image 4" class="img-style next im-6">
<img src="img/5.png" title="Image 4" class="img-style next im-7">
<img src="img/8.png" title="Image 4" class="img-style next im-8">
</div>
html css
This question already has an answer here:
Looping Animation of text color change using CSS3
2 answers
There are 4 text and 8 pictures. One text relate to 2 pictures. The text should change color to red as soon as the picture has changed and remain during 2 pictures and then change color to black again. As soon as 3 picture appears text color is red again until 4 picture etc. I have a problem with timing. How can I set the time in my code?
@keyframes fadeIm-1
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-2
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-3
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-4
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
@keyframes fadeIm-5
{
from { opacity: 1; }
16% { opacity: 1; }
25% { opacity: 0; }
91% { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIm-6
{
from { opacity: 0; }
16% { opacity: 0; }
25% { opacity: 1; }
41% { opacity: 1; }
50% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-7
{
from { opacity: 0; }
41% { opacity: 0; }
50% { opacity: 1; }
66% { opacity: 1; }
75% { opacity: 0; }
to { opacity: 0; }
}
@keyframes fadeIm-8
{
from { opacity: 0; }
66% { opacity: 0; }
75% { opacity: 1; }
91% { opacity: 1; }
to { opacity: 0; }
}
.div-style
{
position: relative;
text-align: center;
width: 99%;
}
.img-style
{
width: 33.3%;
margin-top: 8px;
border: 1px solid #0000ff;
animation-duration: 24s;
animation-iteration-count: infinite;
}
.img-style.next
{
position: absolute;
left: 33.3%;
opacity: 0;
}
.img-style.im-1
{
animation-name: fadeIm-1;
}
.img-style.next.im-2
{
animation-name: fadeIm-2;
}
.img-style.next.im-3
{
animation-name: fadeIm-3;
}
.img-style.next.im-4
{
animation-name: fadeIm-4;
}
.img-style.next.im-5
{
animation-name: fadeIm-5;
}
.img-style.next.im-6
{
animation-name: fadeIm-6;
}
.img-style.next.im-7
{
animation-name: fadeIm-7;
}
.img-style.next.im-8
{
animation-name: fadeIm-8;
}
p{
-webkit-animation: color-change 1s infinite;
-moz-animation: color-change 1s infinite;
-o-animation: color-change 1s infinite;
-ms-animation: color-change 1s infinite;
animation: color-change 1s infinite;
}
@-webkit-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-moz-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-ms-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-o-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
this is html:
<p>Text1</p>
<p>Text2</p>
<p>Text3</p>
<p>Text4</p>
<div class="div-style">
<img src="img/1.png" title="Image 1" class="img-style im-1">
<img src="img/5.png" title="Image 2" class="img-style next im-2">
<img src="img/8.png" title="Image 3" class="img-style next im-3">
<img src="img/9.png" title="Image 4" class="img-style next im-4">
<img src="img/11.png" title="Image 4" class="img-style next im-5">
<img src="img/16.png" title="Image 4" class="img-style next im-6">
<img src="img/5.png" title="Image 4" class="img-style next im-7">
<img src="img/8.png" title="Image 4" class="img-style next im-8">
</div>
This question already has an answer here:
Looping Animation of text color change using CSS3
2 answers
html css
html css
asked Nov 27 '18 at 10:50
Juicy134Juicy134
286
286
marked as duplicate by Yvette Colomb♦ Dec 2 '18 at 2:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Yvette Colomb♦ Dec 2 '18 at 2:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
animation: color-change 1s infinite;set instead1swhat time you want... or hereanimation-duration: 24s;
– לבני מלכה
Nov 27 '18 at 10:58
@לבנימלכה but this is general animation-duration, I need to set for eachp
– Juicy134
Nov 27 '18 at 11:01
Don't post duplicate questions.
– Yvette Colomb♦
Dec 2 '18 at 2:07
add a comment |
animation: color-change 1s infinite;set instead1swhat time you want... or hereanimation-duration: 24s;
– לבני מלכה
Nov 27 '18 at 10:58
@לבנימלכה but this is general animation-duration, I need to set for eachp
– Juicy134
Nov 27 '18 at 11:01
Don't post duplicate questions.
– Yvette Colomb♦
Dec 2 '18 at 2:07
animation: color-change 1s infinite; set instead 1s what time you want... or here animation-duration: 24s;– לבני מלכה
Nov 27 '18 at 10:58
animation: color-change 1s infinite; set instead 1s what time you want... or here animation-duration: 24s;– לבני מלכה
Nov 27 '18 at 10:58
@לבנימלכה but this is general animation-duration, I need to set for each
p– Juicy134
Nov 27 '18 at 11:01
@לבנימלכה but this is general animation-duration, I need to set for each
p– Juicy134
Nov 27 '18 at 11:01
Don't post duplicate questions.
– Yvette Colomb♦
Dec 2 '18 at 2:07
Don't post duplicate questions.
– Yvette Colomb♦
Dec 2 '18 at 2:07
add a comment |
1 Answer
1
active
oldest
votes
Set class to each p and put a diffrent time as below:
See working code
<p class="one">Text1</p>
<p class="two">Text2</p>
css:
p{
animation-name: color-change
animation-iteration-count: infinite;
}
.one{
animation-duration: 3s;
}
.two{
animation-duration: 4s;
}
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
Add it instead yourp{...}
– לבני מלכה
Nov 27 '18 at 11:57
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Set class to each p and put a diffrent time as below:
See working code
<p class="one">Text1</p>
<p class="two">Text2</p>
css:
p{
animation-name: color-change
animation-iteration-count: infinite;
}
.one{
animation-duration: 3s;
}
.two{
animation-duration: 4s;
}
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
Add it instead yourp{...}
– לבני מלכה
Nov 27 '18 at 11:57
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
add a comment |
Set class to each p and put a diffrent time as below:
See working code
<p class="one">Text1</p>
<p class="two">Text2</p>
css:
p{
animation-name: color-change
animation-iteration-count: infinite;
}
.one{
animation-duration: 3s;
}
.two{
animation-duration: 4s;
}
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
Add it instead yourp{...}
– לבני מלכה
Nov 27 '18 at 11:57
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
add a comment |
Set class to each p and put a diffrent time as below:
See working code
<p class="one">Text1</p>
<p class="two">Text2</p>
css:
p{
animation-name: color-change
animation-iteration-count: infinite;
}
.one{
animation-duration: 3s;
}
.two{
animation-duration: 4s;
}
Set class to each p and put a diffrent time as below:
See working code
<p class="one">Text1</p>
<p class="two">Text2</p>
css:
p{
animation-name: color-change
animation-iteration-count: infinite;
}
.one{
animation-duration: 3s;
}
.two{
animation-duration: 4s;
}
edited Nov 27 '18 at 12:01
answered Nov 27 '18 at 11:06
לבני מלכהלבני מלכה
10.5k1826
10.5k1826
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
Add it instead yourp{...}
– לבני מלכה
Nov 27 '18 at 11:57
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
add a comment |
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
Add it instead yourp{...}
– לבני מלכה
Nov 27 '18 at 11:57
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
So, I need to add it in my code, that`s it?
– Juicy134
Nov 27 '18 at 11:56
Add it instead your
p{...}– לבני מלכה
Nov 27 '18 at 11:57
Add it instead your
p{...}– לבני מלכה
Nov 27 '18 at 11:57
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
jsfiddle.net/Lkjmtn5q
– לבני מלכה
Nov 27 '18 at 12:01
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
text changes its color before image change, I need to reverse. when image change, text change to another color
– Juicy134
Nov 27 '18 at 12:03
add a comment |
animation: color-change 1s infinite;set instead1swhat time you want... or hereanimation-duration: 24s;– לבני מלכה
Nov 27 '18 at 10:58
@לבנימלכה but this is general animation-duration, I need to set for each
p– Juicy134
Nov 27 '18 at 11:01
Don't post duplicate questions.
– Yvette Colomb♦
Dec 2 '18 at 2:07