• 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.

CSS/HTML Rotating Text

NikoloV

New Coder
Hello,

i need help with my rotating text code. i have hidden the overflow so the text to dont be misplaced but it does not show all text when rotating (its shortening it). Is there any way to show all text and for it not to be misplaced? Also how i can remove the big gap between the first and the last word? I would like them to be connected together.

Pictures:



CSS:
.offer1 {
  background-color:#f1f2f4;
 height: 50px;   
overflow:hidden;
 overflow-wrap: normal;
 position: relative;

}
.offer1 h3 {
   font-size: 15px;
 color: black;
 position: absolute;
 width: 100%;
 height: 100%;
 margin: 0;
 line-height: 50px;
 text-align: center;
 /* Starting position */
 -moz-transform:translateX(100%);
 -webkit-transform:translateX(100%);   
 transform:translateX(100%);
 /* Apply animation to this element */   
 -moz-animation: offer1 30s linear infinite;
 -webkit-animation: offer1 30s linear infinite;
 animation: offer1 30s linear infinite;
}
/* Move it (define the animation) */
@-moz-keyframes offer1 {
 0%   { -moz-transform: translateX(100%); }
 100% { -moz-transform: translateX(-100%); }
}
@-webkit-keyframes offer1 {
 0%   { -webkit-transform: translateX(100%); }[ICODE][/ICODE]
100% { -webkit-transform: translateX(-100%); }
}
@keyframes offer1 {
 0%   {
 -moz-transform: translateX(100%); /* Firefox bug fix */
 -webkit-transform: translateX(100%); /* Firefox bug fix */
 transform: translateX(100%);         
 }
 100% {
 -moz-transform: translateX(-100%); /* Firefox bug fix */
 -webkit-transform: translateX(-100%); /* Firefox bug fix */
 transform: translateX(-100%);
 }
}

HTML:
<div class="offer1">
<h3>ON SALE • SALE • LIMITED TIME OFFER • 15% OFF • 20% OFF • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • LIMITED TIME OFFER </h3>
</div>

Kind Regards,
NikoloV
 
Hello,

i need help with my rotating text code. i have hidden the overflow so the text to dont be misplaced but it does not show all text when rotating (its shortening it). Is there any way to show all text and for it not to be misplaced? Also how i can remove the big gap between the first and the last word? I would like them to be connected together.

Pictures:



CSS:
.offer1 {
  background-color:#f1f2f4;
 height: 50px;  
overflow:hidden;
 overflow-wrap: normal;
 position: relative;

}
.offer1 h3 {
   font-size: 15px;
 color: black;
 position: absolute;
 width: 100%;
 height: 100%;
 margin: 0;
 line-height: 50px;
 text-align: center;
 /* Starting position */
 -moz-transform:translateX(100%);
 -webkit-transform:translateX(100%);  
 transform:translateX(100%);
 /* Apply animation to this element */  
 -moz-animation: offer1 30s linear infinite;
 -webkit-animation: offer1 30s linear infinite;
 animation: offer1 30s linear infinite;
}
/* Move it (define the animation) */
@-moz-keyframes offer1 {
 0%   { -moz-transform: translateX(100%); }
 100% { -moz-transform: translateX(-100%); }
}
@-webkit-keyframes offer1 {
 0%   { -webkit-transform: translateX(100%); }[ICODE][/ICODE]
100% { -webkit-transform: translateX(-100%); }
}
@keyframes offer1 {
 0%   {
 -moz-transform: translateX(100%); /* Firefox bug fix */
 -webkit-transform: translateX(100%); /* Firefox bug fix */
 transform: translateX(100%);        
 }
 100% {
 -moz-transform: translateX(-100%); /* Firefox bug fix */
 -webkit-transform: translateX(-100%); /* Firefox bug fix */
 transform: translateX(-100%);
 }
}

HTML:
<div class="offer1">
<h3>ON SALE • SALE • LIMITED TIME OFFER • 15% OFF • 20% OFF • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • ON SALE • LIMITED TIME OFFER </h3>
</div>

Kind Regards,
NikoloV
Hi there,
Not sure what the issue is. I copied your code and ran it locally on my end, and it seems to be working fine, at least in Chrome. What browser were you testing on?
 
Worked for me in Arc (Chromium Engine Version 117.0.5938.88) and Firefox 117.0.1. Prettier was confused by the [ICODE] in there. I removed that and fixed Prettier's mistakes and it was fine.
 

New Threads

Latest posts

Buy us a coffee!

300x250
Top Bottom