Sep 7, 2019 01:38 AM
(This post was last modified: Sep 7, 2019 02:04 AM by Rishabh.)
Hey guys!
So I referred to this guide - https://labrumfield.com/rotating-text-wi...nimations/ for adding rotating text in a heading on my webpage.
I had to obviously modify the final output used by the blogger there in order for it suite my web page's design. Essentially, my heading is aligned centrally, while she has aligned it to the left. Like her, I am using the code to rotate three sets of words as well. So you can refer to the final set of code she used on her website.
The problem I am facing is that each set is coming down below the other, rather than showing up in the same place as the last set, i.e. this - https://gph.is/g/apVDXd6
Here's the code -
HTML:
CSS:
I am just not sure how to go about fixing this issue at the moment. Any help would be appreciated.
So I referred to this guide - https://labrumfield.com/rotating-text-wi...nimations/ for adding rotating text in a heading on my webpage.
I had to obviously modify the final output used by the blogger there in order for it suite my web page's design. Essentially, my heading is aligned centrally, while she has aligned it to the left. Like her, I am using the code to rotate three sets of words as well. So you can refer to the final set of code she used on her website.
The problem I am facing is that each set is coming down below the other, rather than showing up in the same place as the last set, i.e. this - https://gph.is/g/apVDXd6
Here's the code -
HTML:
Code
<div id="cspio-content" class="wrapper">
<img id="cspio-logo" src="images/logo.png">
<h1 id="cspio-headline" class="sentence">TECHNOLOGY THAT <br />
<div class="slidingVertical">
<span>REDEFINES LEARNING</span>
<span>SPARKS KNOWLEDGE</span>
<span>GUIDES RESEARCH</span>
</div>
</h1>CSS:
Code
/*Wrapper*/
.wrapper{
margin: 100px auto;
position: relative;
width: 100%;
}
/*Sentence*/
.sentence{
text-align:center;
}
/*Vertical Sliding*/
.slidingVertical {
display: inline;
text-indent: 8px;
}
.slidingVertical span{
animation: topToBottom 7.5s linear infinite 0s;
-ms-animation: topToBottom 7.5s linear infinite 0s;
-webkit-animation: topToBottom 7.5s linear infinite 0s;
color: #1e66b5;
opacity: 0;
overflow: hidden;
position: relative;
}
.slidingVertical span:nth-child(2){
animation-delay: 2.5s;
-ms-animation-delay: 2.5s;
-webkit-animation-delay: 2.5s;
}
.slidingVertical span:nth-child(3){
animation-delay: 5s;
-ms-animation-delay: 5s;
-webkit-animation-delay: 5s;
}
/*topToBottom Animation*/
@-moz-keyframes topToBottom{
0% { opacity: 0; }
5% { opacity: 0; -moz-transform: translateY(-50px); }
10% { opacity: 1; -moz-transform: translateY(0px); }
25% { opacity: 1; -moz-transform: translateY(0px); }
30% { opacity: 0; -moz-transform: translateY(50px); }
80% { opacity: 0; }
100% { opacity: 0; }
}
@-webkit-keyframes topToBottom{
0% { opacity: 0; }
5% { opacity: 0; -webkit-transform: translateY(-50px); }
10% { opacity: 1; -webkit-transform: translateY(0px); }
25% { opacity: 1; -webkit-transform: translateY(0px); }
30% { opacity: 0; -webkit-transform: translateY(50px); }
80% { opacity: 0; }
100% { opacity: 0; }
}
@-ms-keyframes topToBottom{
0% { opacity: 0; }
5% { opacity: 0; -ms-transform: translateY(-50px); }
10% { opacity: 1; -ms-transform: translateY(0px); }
25% { opacity: 1; -ms-transform: translateY(0px); }
30% { opacity: 0; -ms-transform: translateY(50px); }
80% { opacity: 0; }
100% { opacity: 0; }
}I am just not sure how to go about fixing this issue at the moment. Any help would be appreciated.



![[Image: fpZ5a5g.png]](https://i.imgur.com/fpZ5a5g.png)