I am trying to make my website http://www.TheTapReport.com lower bottom scroll animation "arrow" display center on an iPad Safari Browser instead of left justified. The text "scroll" and the mouse objects appear to be centered, however, the arrow is not. I have tested this animation on most browsers and all appears to be always centered except for with the iPad.
#scrolldown {
bottom: 40px;
height: 100px;
margin-left: -50px;
position: fixed;
left: 50%;
text-align: center;
width: 100px;
z-index: 100;
}
#scrolldown p {
font: 700 0.7em/1em 'Avenir',sans-serif;
animation-duration: 2s;
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-name: scroll;
-webkit-animation-duration: 2s;
-webkit-animation-fill-mode: both;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: scroll;
-moz-animation-duration: 2s;
-moz-animation-fill-mode: both;
-moz-animation-iteration-count: infinite;
-moz-animation-name: scroll;
-o-animation-name: scroll;
-o-animation-duration: 2s;
-o-animation-fill-mode: both;
-o-animation-iteration-count: infinite;
}
#scrolldown > p {
font: 700 0.7em/1em 'Avenir',sans-serif;
animation-duration: 2s;
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-name: scroll;
-webkit-animation-duration: 2s;
-webkit-animation-fill-mode: both;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: scroll;
-moz-animation-duration: 2s;
-moz-animation-fill-mode: both;
-moz-animation-iteration-count: infinite;
-moz-animation-name: scroll;
-o-animation-name: scroll;
-o-animation-duration: 2s;
-o-animation-fill-mode: both;
-o-animation-iteration-count: infinite;
}
.mouse {
border: 2px solid #000;
border-radius: 13px;
display: block;
height: 46px;
left: 50%;
margin: 10px 0 0 -13px;
position: fixed;
width: 26px;
}
.mouse {
border: 2px solid #7C7D7F;
border-radius: 13px;
display: block;
height: 46px;
left: 50%;
margin: 10px 0 0 -13px;
position: fixed;
width: 26px;
}
.mouse span {
display: block;
font-size: 1 em;
margin: 6px auto;
}
#-moz-keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(5px);
}
}
#-o-keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(5px);
}
}
#-webkit-keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(5px);
}
}
#keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(5px);
}
}
Thank you
Related
I have started to create a CSS based animation here -
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #999999 !important;
height: 100vh;
width: 100vw;
font-size: 16px;
}
.loading-overlay {
width: 100vw;
height: 100vh;
position: absolute;
left: 0;
top: 0;
z-index: 900;
background-color: #FFFFFF !important;
}
.loading-overlay.relative {
position: relative !important;
left: 0 !important;
width: auto !important;
height: auto !important;
}
.loading-overlay .brand-logo-animation-loop {
height: 12rem;
width: 12rem;
display: block;
position: absolute;
right: calc(50% - 6rem);
top: calc(50% - 6rem);
}
.loading-overlay .brand-logo-animation-loop .shape1 {
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-width: 6rem 0 6rem 6rem;
border-color: transparent transparent transparent #FAE6FF;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: shape1;
animation-name: shape1;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.loading-overlay .brand-logo-animation-loop .shape2 {
position: absolute;
left: 6rem;
width: 0;
height: 0;
border-style: solid;
border-width: 6rem 6rem 6rem 0;
border-color: transparent #FAE6FF transparent transparent;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: shape2;
animation-name: shape2;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.loading-overlay .brand-logo-animation-loop .shape3 {
width: 0;
height: 0;
opacity: 0;
border-style: solid;
border-width: 3rem 0 3rem 3rem;
border-color: transparent transparent transparent #660296;
position: absolute;
z-index: 200;
top: 3rem;
left: 3rem;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: shape3;
animation-name: shape3;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
transform-origin: top left;
}
.loading-overlay .brand-logo-animation-loop .shape3:before {
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 3rem 3rem 3rem 0;
border-color: transparent #660296 transparent transparent;
position: absolute;
top: -3rem;
right: 3rem;
}
.loading-overlay .brand-logo-animation-loop .shape3 {
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
.loading-overlay .brand-logo-animation-loop .shape4 {
width: 0;
height: 0;
border-style: solid;
border-width: 3rem 0 3rem 3rem;
border-color: transparent transparent transparent #8203C0;
position: absolute;
z-index: 100;
bottom: 0;
left: 6rem;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: shape4;
animation-name: shape4;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
transform-origin: top left;
opacity: 0;
}
.loading-overlay .brand-logo-animation-loop .shape4:before {
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 3rem 3rem 3rem 0;
border-color: transparent #8203C0 transparent transparent;
position: absolute;
top: -3rem;
right: 3rem;
}
.loading-overlay .brand-logo-animation-loop .shape4 {
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.loading-overlay .brand-logo-animation-loop .shape5 {
width: 0;
height: 0;
border-style: solid;
border-width: 3rem 0 3rem 3rem;
border-color: transparent transparent transparent #8203C0;
position: absolute;
bottom: 0;
opacity: 0;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: shape5;
animation-name: shape5;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.loading-overlay .brand-logo-animation-loop .shape5 {
-webkit-animation-delay: 6s;
animation-delay: 6s;
}
#-webkit-keyframes master-turn {
0% {
transform: rotate(-45deg);
}
25% {
transform: rotate(-45deg);
}
40% {
transform: rotate(0deg);
}
60% {
transform: rotate(0deg);
}
75% {
transform: rotate(-45deg);
}
100% {
transform: rotate(-45deg);
}
}
#keyframes master-turn {
0% {
transform: rotate(-45deg);
}
25% {
transform: rotate(-45deg);
}
40% {
transform: rotate(0deg);
}
60% {
transform: rotate(0deg);
}
75% {
transform: rotate(-45deg);
}
100% {
transform: rotate(-45deg);
}
}
#-webkit-keyframes shape1 {
0% {
left: 3rem;
opacity: 0;
}
20% {
left: calc($smallSize - 1rem);
opacity: 0.2;
}
80% {
left: calc($smallSize - 2rem);
opacity: 0.8;
}
100% {
left: 0rem;
opacity: 1;
}
}
#keyframes shape1 {
0% {
left: 3rem;
opacity: 0;
}
20% {
left: calc($smallSize - 1rem);
opacity: 0.2;
}
80% {
left: calc($smallSize - 2rem);
opacity: 0.8;
}
100% {
left: 0rem;
opacity: 1;
}
}
#-webkit-keyframes shape2 {
0% {
left: -3rem;
opacity: 0;
transform: rotate(-180deg);
}
20% {
left: 0rem;
opacity: 0.2;
transform: rotate(-90deg);
}
80% {
left: 3rem;
opacity: 0.8;
}
100% {
left: 6rem;
opacity: 1;
transform: rotate(0deg);
}
}
#keyframes shape2 {
0% {
left: -3rem;
opacity: 0;
transform: rotate(-180deg);
}
20% {
left: 0rem;
opacity: 0.2;
transform: rotate(-90deg);
}
80% {
left: 3rem;
opacity: 0.8;
}
100% {
left: 6rem;
opacity: 1;
transform: rotate(0deg);
}
}
#-webkit-keyframes shape3 {
0% {
opacity: 0;
transform: scale(0);
}
20% {
pacity: 0.2;
transform: scale(0.5);
}
80% {
opacity: 0.8;
transform: scale(1);
}
100% {
opacity: 1;
}
}
#keyframes shape3 {
0% {
opacity: 0;
transform: scale(0);
}
20% {
pacity: 0.2;
transform: scale(0.5);
}
80% {
opacity: 0.8;
transform: scale(1);
}
100% {
opacity: 1;
}
}
#-webkit-keyframes shape4 {
0% {
bottom: 3rem;
left: 3rem;
opacity: 0;
}
50% {
bottom: 3rem;
left: 3rem;
opacity: 0.5;
}
100% {
bottom: 0rem;
left: 6rem;
opacity: 1;
}
}
#keyframes shape4 {
0% {
bottom: 3rem;
left: 3rem;
opacity: 0;
}
50% {
bottom: 3rem;
left: 3rem;
opacity: 0.5;
}
100% {
bottom: 0rem;
left: 6rem;
opacity: 1;
}
}
#-webkit-keyframes shape5 {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 1;
}
}
#keyframes shape5 {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 1;
}
}
<div class="loading-overlay">
<div class="brand-logo-animation-loop">
<div class="shape1"></div>
<div class="shape2"></div>
<div class="shape3"></div>
<div class="shape4"></div>
<div class="shape5"></div>
</div>
</div>
Codepen: https://codepen.io/erswelljustin/pen/ExbKMaz
I am stuck on the timing and how to have it run forwards and then reverse out.
Explanation:
Shape 1 and Shape 2 should play first with Shape 2 rotating in from the left of its container, once this has finished then the Shape 3 animation should run, then Shape 4 and Shape 5 after that, once all completed I need to reverse the process until the shapes are gone.
I would like the whole animation to run infinitely as it is supposed to be a loading animation for an app.
I have been staring at this for days and no mater the delays I place it seems to ruin oddly, can any one help me please.
Note: I'd like to avoid using JavaScript with this.
It seems that the animation-delay:6 simply doesn't sync for 100% with the actual duration of another animation that lasts 6 seconds. Especially when it keeps looping.
You might try making all animations the same length (say 10 seconds) and only use the keyframe percentages to decide when an animation starts or stops. For example, here shape2 becomes visible after shape1 became visible.
.shape1 {
width:100px;
height:100px;
background-color:green;
animation: shape1 3s infinite linear;
}
.shape2 {
width:100px;
height:100px;
background-color:blue;
animation: shape2 3s infinite linear;
}
#keyframes shape1 {
0% {
opacity: 0;
}
20% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
opacity: 1;
}
}
#keyframes shape2 {
0% {
opacity: 0;
}
20% {
opacity: 0;
}
40% {
opacity: 1;
}
100% {
opacity: 1;
}
}
<div class="shape1"></div>
<div class="shape2"></div>
I am trying to get rid of white space after I animate and translateY. Maybe setting the body height to auto? Does translateY leave a margin at the bottom or is that just the body white space, I can't click on it in inspect. Here is my code in a codepen. The white space is after my last div, I have attached my code and keyframes.
body{
padding: 0;
margin: 0;
overflow-x: hidden;
}
.banner{
position: relative;
transform: scale(1.5);
background: url(../image/splashing.jpg) center no-repeat;
background-size: cover;
background-attachment: fixed;
height: 100vh;
animation: slides 1s;
animation-delay:2s;
animation-iteration-count: 1;
animation-timing-function: cubic-bezier(0,0,0,1);
animation-fill-mode:forwards;
-webkit-animation:slides 1s;
-webkit-animation-delay:2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: cubic-bezier(0,0,0,1);
-webkit-animation-fill-mode: forwards;
}
.header h1{
display: block;
position: absolute;
bottom: 15vh;
left: 0;
}
.header{
position: relative;
color: white;
opacity: 0;
animation: Fade 1s;
animation-delay: 3s;
animation-timing-function: cubic-bezier(0,0,1,1);
animation-fill-mode: forwards;
animation-iteration-count: 1;
-webkit-animation-iteration-count: 1;
-webkit-animation: Fade 1s;
-webkit-animation-timing-function: cubic-bezier(0,0,1,1);
-webkit-animation-delay:3s;
-webkit-animation-fill-mode: forwards;
z-index: 999;
}
.orange{
background-color: orange;
animation: up .5s;
animation-delay: 2s;
animation-fill-mode: forwards;
animation-timing-function: ease-in-out;
animation-iteration-count: 1;
-webkit-animation: up .5s;
-webkit-animation-delay: 2s;
-webkit-animation-fill-mode: forwards;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: 1;
}
#-webkit-keyframes slides{
0%{
-webkit-transform: scale(2,2);
}
100%{
-webkit-transform: scale(1,1);
}
}
#-webkit-keyframes Fade{
from{
opacity: 0;
}
to{
opacity: 1;
}
}
#-webkit-keyframes up{
from{
-webkit-transform: translateY(0);
}
to{
-webkit-transform: translateY(-30%);
}
}
using position:absolute; in class orange will do the trick
I am struggling to get the word "Breaking" to be centered in the Box it is in. I am also struggling getting the scrolling to be continuous, right now there is too much of a delay. I would also like the "Breaking", and the "TEST" headline to stand out, and be more bold. Right now the coding is done, and it works. Just a few minor tweaks. Also is it possible to make whatever I type into "breaking"and test" be a link as well?
.breaking-news-headline {
display: block;
position: absolute;
font-family: arial;
font-size: 15px;
margin-top: -22px;
color: white;
margin-left: 150px;
}
.breaking-news-title {
background-color: #FFFF00;
display: block;
height: 20px;
width: 120px;
font-family: arial;
font-size: 15px;
position: absolute;
top: 0px;
margin-top: auto;
margin-left: auto;
padding-top: 10px;
padding-left: 10px;
z-index: 3;
&:before {
content: "";
position: absolute;
display: block;
width: 0px;
height: 0px;
top: 10;
left: -12px;
border-left: 12px solid transparent;
border-right: 0px solid transparent;
border-bottom: 30px solid #FFEA00;
}
&:after {
content: "";
position: absolute;
display: block;
width: 10px;
height: 0px;
right: -12px;
top: 0;
border-right: 12px solid transparent;
border-left: 0px solid transparent;
border-top: 30px solid #FFEA00;
}
}
#breaking-news-colour {
height: 30px;
width: 2394px;
background-color: #FF0000;
}
#breaking-news-container {
height: 30px;
width: 800px;
overflow: hidden;
position: absolute;
&:before {
content: "";
width: 30px;
height: 30px;
background-color: #3399FF;
position: absolute;
z-index: 2;
}
}
.animated {
-webkit-animation-duration: 0.2s;
-webkit-animation-fill-mode: both;
-moz-animation-duration: 0.2s;
-moz-animation-fill-mode: both;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
}
.delay-animated {
-webkit-animation-duration: 0.4s;
-webkit-animation-fill-mode: both;
-moz-animation-duration: 0.4s;
-moz-animation-fill-mode: both;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.scroll-animated {
-webkit-animation-duration: 3s;
-webkit-animation-fill-mode: both;
-moz-animation-duration: 3s;
-moz-animation-fill-mode: both;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
.delay-animated2 {
-webkit-animation-duration: 0.4s;
-webkit-animation-fill-mode: both;
-moz-animation-duration: 0.4s;
-moz-animation-fill-mode: both;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
.delay-animated3 {
-webkit-animation-duration: 5s;
-webkit-animation-fill-mode: both;
-moz-animation-duration: 5s;
-moz-animation-fill-mode: both;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-delay: 0.5s;
animation-delay: 3s;
}
.fadein {
-webkit-animation-name: fadein;
-moz-animation-name: fadein;
-o-animation-name: fadein;
animation-name: fadein;
}
#-webkit-keyframes fadein {
from {
margin-left: 1000px
}
to {}
}
#-moz-keyframes fadein {
from {
margin-left: 1000px
}
to {}
}
.slidein {
-webkit-animation-name: slidein;
-moz-animation-name: slidein;
-o-animation-name: slidein;
animation-name: slidein;
}
#keyframes marquee {
0% {
left: 0;
}
20% {
left: 0;
}
100% {
left: -100%;
}
}
.marquee {
animation: marquee 3s linear infinite;
-webkit-animation-duration: 10s;
-moz-animation-duration: 10a;
-webkit-animation-delay: 0.5s;
animation-delay: 3s;
}
#-webkit-keyframes slidein {
from {
margin-left: 800px
}
to {
margin-top: 0px
}
}
#-moz-keyframes slidein {
from {
margin-left: 800px
}
to {
margin-top: 0px
}
}
.slideup {
-webkit-animation-name: slideup;
-moz-animation-name: slideup;
-o-animation-name: slideup;
animation-name: slideup;
}
#-webkit-keyframes slideup {
from {
margin-top: 30px
}
to {
margin-top: 0;
}
}
#-moz-keyframes slideup {
from {
margin-top: 30px
}
to {
margin-top: 0;
}
}
<div id="breaking-news-container">
<div id="breaking-news-colour" class="slideup animated">
</div>
<span class="breaking-news-title delay-animated slidein">
BREAKING
</span>
<a class="breaking-news-headline delay-animated2 fadein marquee">
TEST
</a>
</div>
I am struggling to get the word "Breaking" to be centered in the Box it is in
.breaking-news-title {
text-align: center;
font-weight: bold;
padding-top: 7px;
height: 30px;
}
delete → padding-left: 0px;
I would also like the "Breaking", and the "TEST" headline to stand
out, and be more bold.
just add font-weight: bold;
Also is it possible to make whatever I type into "breaking"and test"
be a link as well? Thanks!
yes, replace your span to <a> tag and your "TEST" is already <a> tag
and by the way according to caniuse.com <marquee> tag is deprecated so you should not use it
http://caniuse.com/#search=marquee
but here is the edit I made
https://jsfiddle.net/gs8p0zc3/
use this css3 animation instead of marquee
EDIT made similar design of your code
https://jsfiddle.net/sfjjvpk5/1/
I am trying to add this scroll animation script to my website: http://codepen.io/zutrinken/pen/yhqEA
#scrolldown {
bottom: 40px;
height: 100px;
margin-left: -50px;
position: absolute;
left: 50%;
text-align: center;
width: 100px;
z-index: 100;
}
#scrolldown p {
font: 700 0.7em/1em 'Avenir',sans-serif;
animation-duration: 2s;
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-name: scroll;
color: #000;
}
#scrolldown > p {
text-transform: uppercase;
text-indent: 3px;
}
.mouse {
border: 2px solid #000;
border-radius: 13px;
display: block;
height: 46px;
left: 50%;
margin: 10px 0 0 -13px;
position: absolute;
width: 26px;
}
.mouse span {
display: block;
font-size: 1.5em;
margin: 6px auto;
}
#keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(10px);
}
}
<div id="scrolldown">
<p>scroll</p>
<div class="mouse">
<span><p>↓</p></span>
</div>
</div>
The animation works in Chrome while in Code Pen but i can not get it to work outside of Code Pen. How Can I get this script to work with other browsers?
http://rapidevac.biz/tapreport/ This is my website that i added the script to. Like i said, it works with IE 9 but not with other browsers.
Thanks guys for reviewing my question!
Add this after your #keyframes scroll to se the animation in all browsers
#-moz-keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(10px);
}
}
#-o-keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(100px);
}
}
#-webkit-keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(100px);
}
}
#keyframes scroll {
0% {
opacity: 1;
transform: translateY(0px);
}
100% {
opacity: 0;
transform: translateY(10px);
}
}
Your transitions are not cross-browser friendly.
Change your #scrolldown p css to this:
#scrolldown p {
font: 700 0.7em/1em 'Avenir',sans-serif;
animation-duration: 2s;
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-name: scroll;
-webkit-animation-duration: 2s;
-webkit-animation-fill-mode: both;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: scroll;
-moz-animation-duration: 2s;
-moz-animation-fill-mode: both;
-moz-animation-iteration-count: infinite;
-moz-animation-name: scroll;
-o-animation-name: scroll;
-o-animation-duration: 2s;
-o-animation-fill-mode: both;
-o-animation-iteration-count: infinite;
}
How to put my text moving from beginig to the end of the div constantly. I did something like this http://jsfiddle.net/swh2jqrg/ on my web page, but my message is going out in new line. I want that my text goes in a loop(circle). how to do that? my css looks like this:
.message1{
width: 1240px;
height: 94px;
font-size: 70px;
text-align:center;
color: white;
animation-duration: 10s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-delay: forwards;
animation-direction: normal;
}
#keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
Why this isn't working in Crome? sorry for the english and thanks for the answer.
You need to add vendor prefixes for chrome, -webkit-:
.content1{
width: 1280px;
height: 322px;
}
.message{
width: 1240px;
height: 94px;
background-color:#5292a5;
margin: 25px 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.message1{
width: 1240px;
height: 94px;
font-size: 70px;
text-align:center;
color: white;
-webkit-animation-duration: 10s;
-webkit-animation-name: slidein;
-webkit-animation-iteration-count: infinite;
-webkit-animation-delay: forwards;
-webkit-animation-direction: normal;
animation-duration: 10s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-delay: forwards;
animation-direction: normal;
}
#-webkit-keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
#keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
Demo in a fiddle: http://jsfiddle.net/swh2jqrg/1/
Also, in order for the animation to work in mozilla and opera you'll need to add the -moz- and -o- prefixes as well.
ie:
.content1{
width: 1280px;
height: 322px;
}
.message{
width: 1240px;
height: 94px;
background-color:#5292a5;
margin: 25px 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.message1{
width: 1240px;
height: 94px;
font-size: 70px;
text-align:center;
color: white;
-webkit-animation-duration: 10s;
-webkit-animation-name: slidein;
-webkit-animation-iteration-count: infinite;
-webkit-animation-delay: forwards;
-webkit-animation-direction: normal;
-moz-animation-duration: 10s;
-moz-animation-name: slidein;
-moz-animation-iteration-count: infinite;
-moz-animation-delay: forwards;
-moz-animation-direction: normal;
-o-animation-duration: 10s;
-o-animation-name: slidein;
-o-animation-iteration-count: infinite;
-o-animation-delay: forwards;
-o-animation-direction: normal;
animation-duration: 10s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-delay: forwards;
animation-direction: normal;
}
#-webkit-keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
#-moz-keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
#-o-keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
#keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
Demo in a fiddle: http://jsfiddle.net/swh2jqrg/3/
Or you can use another method with text-indent and text-shadow to have no wholes in between each loops :DEMO
.message{
width: 1240px;
background-color:#5292a5;
margin: 25px 20px;
border-radius: 5px;
overflow:hidden;
text-shadow:0 0 2px red, 1240px 0 , 1240px 0 2px blue;/* pick here another color for text mirrored */
animation:slidein infinite 10s linear;
font-size:60px;
color:turquoise;
line-height:94px;
}
.message1 {
display:inline-block;
width:100%;
text-indent:0;
}
#keyframes slidein {
from {
text-indent:-100%;
}
to {
text-indent:0%;
}
}
You need to add vendor prefix -webkit- for Chrome/Opera/Safari. Check CanIuse?
CSS
.message1{
width: 1240px;
height: 94px;
font-size: 70px;
text-align:center;
color: white;
-webkit-animation-duration: 10s;
-webkit-animation-name: slidein;
-webkit-animation-iteration-count: infinite;
-webkit-animation-delay: forwards;
-webkit-animation-direction: normal;
animation-duration: 10s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-delay: forwards;
animation-direction: normal;
}
#-webkit-keyframes slidein {
from {
margin-left: 0%;
width: 300%;
height:94px;
}
to {
margin-left: 100%;
width: 1240px;
height:94px;
}
}
JSFiddle DEMO