Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Custom CSS for revolving text

Bradaz21

New Coder
Hi,

I'm currently building a website using squarespace and I want to create a header that has text that revolves. I've attached a image of what I am trying to achieve using html and css.

I want the parts of text that are underlined to revolve so that each time they change it creates a new sentence. If the previous and next words could be partially visible e.g. faded like shown above and below that would be great. I've got part of the way but the text doesn't seem to be revolving correctly and i'm not sure how to get the two to revolve at the same time.

Any help would be appreciated!

Bradaz

HTML
HTML:
<p class="rotatingText">
Take the stress out of

  <span class="rotatingText-adjective">extending</span>
  <span class="rotatingText-adjective">renovating</span>
  <span class="rotatingText-adjective">building</span>
</p>

CSS:
.rotatingText {
  font-family: "Balto-Light";
  font-style: normal;
  font-size: 40px;
  text-align: left;
}

[B]CSS[/B]
.rotatingText-adjective {
  font-family: "Balto-bold";
  font-size: 40px;
  font-style: underline;
  font-weight: 700;
  left: 0px;
  margin-bottom: 0;
  margin-top: 1px;
  opacity: 0;
  position: absolute;
  right: 500px;
  text-align: center;
  text-transform: uppercase;
  top: 0;
}

.rotatingText-adjective:nth-of-type(1) {
  animation-name: rotate;
  animation-duration: 2s;
  animation-delay: 1s;
}

.rotatingText-adjective:nth-of-type(2) {
  animation-name: rotate;
  animation-duration: 2s;
  animation-delay: 1s;
}

.rotatingText-adjective:nth-of-type(3) {
  animation-name: rotate-last;
  animation-duration: 2;
  animation-delay: 3s;
  animation-fill-mode: forwards;
}

@keyframes rotate {
  0% {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
  }
 
  20%, 80% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
 
  100% {
    opacity: 0;
    transform: translate3d(0, -25px, 0);
  }
}

@keyframes rotate-last {
  0% {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
  }
 
  50%, 100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
 

New Threads

Buy us a coffee!

Back
Top Bottom