How to aimate the before and after pseudo elements? - html

I want to make like this shape using HTML and CSS:
this is my code but why the before and after elements don't stop rotation when I hover on it:
Code:
body {
height: 100vh;
padding: 0;
margin: 0;
position: relative;
}
#keyframes rotate {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
div {
background-color: #eee;
width: 50px;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
color: #000000;
font-size: 30px;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 10px solid;
border-color: transparent #ea2264 #ea2264 #ea2264;
border-radius: 50%;
animation-name: rotate;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
div::before {
content: "";
position: absolute;
width: 75px;
height: 75px;
border: 10px solid;
border-color: #1790e1 #1790e1 transparent #1790e1;
border-radius: 50%;
animation-name: rotate;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
div::after {
content: "";
position: absolute;
width: 100px;
height: 100px;
border: 10px solid;
border-color: #fca400 #fca400 #fca400 transparent;
border-radius: 50%;
animation-name: rotate;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
div:hover {
animation-play-state: paused;
}
div::after:hover {
animation-play-state: paused;
}
div::before:hover {
animation-play-state: paused;
}
<div></div>
My question is how to animate and pause the rotation of two pseudo elements when I hover on it to make like the design in the picture?

Simply change your selectors from:
div:hover {
animation-play-state: paused;
}
div::after:hover {
animation-play-state: paused;
}
div::before:hover {
animation-play-state: paused;
}
to:
div:hover,
div:hover::after,
div:hover::before {
animation-play-state: paused;
}
your selectors indicate an over on the pseudo-elements. since you only hover the div itself you need to add the ::before/after selector after the :hover selector.
body {
height: 100vh;
padding: 0;
margin: 0;
position: relative;
}
#keyframes rotate {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
div {
background-color: #eee;
width: 50px;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
color: #000000;
font-size: 30px;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 10px solid;
border-color: transparent #ea2264 #ea2264 #ea2264;
border-radius: 50%;
animation-name: rotate;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
div::before {
content: "";
position: absolute;
width: 75px;
height: 75px;
border: 10px solid;
border-color: #1790e1 #1790e1 transparent #1790e1;
border-radius: 50%;
animation-name: rotate;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
div::after {
content: "";
position: absolute;
width: 100px;
height: 100px;
border: 10px solid;
border-color: #fca400 #fca400 #fca400 transparent;
border-radius: 50%;
animation-name: rotate;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
div:hover,
div:hover::after,
div:hover::before {
animation-play-state: paused;
}
<div></div>

Related

CSS Pure loading spin rotates full turn before it shows the delay function associated with pseudo elements

This loading spinner I have created doesn't show the delay function at the moment I hover on the element, but it rotates a full turn before creating the animation on the second turn; how could I debug this issue?
Kindly, check my codepen code link so you can get what I mean, thank you.
Codepen
Each border of spin pseudo elements must move at different timing from the beginning when I hover on the element, I have set the animation delay function, and it works properly but not at the first turn.
This is how I wrote the code:
.spin {
margin: auto;
margin-top: 23px;
margin-bottom: 23px;
}
.spin div {
width: 50px;
height: 50px;
margin: auto;
border-radius: 50%;
border: 3px solid #2196f3;
border-bottom-color: transparent;
position: relative;
animation-name: spinning;
animation-duration: 1s;
animation-play-state: paused;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.spin div::before {
content: "";
position: absolute;
top: -3px;
right: -3px;
width: 100%;
height: 100%;
border-radius: 50%;
border: 3px solid orange;
border-bottom-color: transparent;
scale: 1.2;
animation-name: spinning;
animation-duration: 2s;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-play-state: paused;
animation-timing-function: linear;
}
.spin div::after {
content: "";
position: absolute;
top: -3px;
right: -3px;
width: 100%;
height: 100%;
border-radius: 50%;
border: 3px solid black;
border-bottom-color: transparent;
scale: 1.4;
animation-name: spinning;
animation-duration: 2s;
animation-delay: 2s;
animation-play-state: paused;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.spin div:hover {
animation-play-state: running;
}
.spin div:hover::before {
animation-play-state: running;
}
.spin div:hover::after {
animation-play-state: running;
}
#keyframes spinning {
100% {
transform: rotate(1turn)
}
}
<div class="spin">
<div></div>
</div>
Commenting out the initial animation-delay: 1s causes the spinners to start immediately out of sync, which I believe is the behavior you are seeking.
.spin {
margin: auto;
margin-top: 23px;
margin-bottom: 23px;
}
.spin div {
width: 50px;
height: 50px;
margin: auto;
border-radius: 50%;
border: 3px solid #2196f3;
border-bottom-color: transparent;
position: relative;
animation-name: spinning;
animation-duration: 1s;
animation-play-state: paused;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.spin div::before {
content: "";
position: absolute;
top: -3px;
right: -3px;
width: 100%;
height: 100%;
border-radius: 50%;
border: 3px solid orange;
border-bottom-color: transparent;
scale: 1.2;
animation-name: spinning;
animation-duration: 2s;
/*animation-delay: 1s;*/
animation-iteration-count: infinite;
animation-play-state: paused;
animation-timing-function: linear;
}
.spin div::after {
content: "";
position: absolute;
top: -3px;
right: -3px;
width: 100%;
height: 100%;
border-radius: 50%;
border: 3px solid black;
border-bottom-color: transparent;
scale: 1.4;
animation-name: spinning;
animation-duration: 2s;
animation-delay: 2s;
animation-play-state: paused;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.spin div:hover {
animation-play-state: running;
}
.spin div:hover::before {
animation-play-state: running;
}
.spin div:hover::after {
animation-play-state: running;
}
#keyframes spinning {
100% {
transform: rotate(1turn)
}
}
<div class="spin">
<div></div>
</div>
As for how to debug it-- there is an "animations drawer" in the Chrome dev tools: you can learn more about the Chrome dev tools animations drawer in this blog post.
Problem is that your first animation spins all 3 of the elements. Your pseudo elements start spinning only after their delay is over. If you want to offset animations from the very beginning you have 2 options.
use negative animation-delay, so for example animation-duration: -2s;
use separate not nested elements for each spinning element.

How To Shrink My Loading Screen (CSS, HTML)

So, I found this loading screen on the internet and I made a bunch of tweaks to it but I am not sure how to shrink it. Here is my code:
CSS
body {
background-color: #90EE90;
}
#loading-wrapper {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
#loading-text {
display: block;
position: absolute;
top: 100%;
left: 100%;
color: #999;
width: 100px;
height: 30px;
margin: -7px 0 0 -45px;
text-align: center;
font-family: 'PT Sans Narrow', sans-serif;
font-size: 20px;
}
#loading-content {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 170px;
height: 170px;
margin: -85px 0 0 -85px;
border: 3px solid #F00;
}
#loading-content:after {
content: "";
position: absolute;
border: 3px solid #0F0;
left: 15px;
right: 15px;
top: 15px;
bottom: 15px;
}
#loading-content:before {
content: "";
position: absolute;
border: 3px solid #00F;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
}
#loading-content {
border: 3px solid transparent;
border-top-color: #20B2AA;
border-bottom-color: #20B2AA;
border-radius: 50%;
-webkit-animation: loader 3.5s linear infinite;
-moz-animation: loader 3.5s linear infinite;
-o-animation: loader 3.5s linear infinite;
animation: loader 3.5s linear infinite;
}
#loading-content:before {
border: 3px solid transparent;
border-top-color: #778899;
border-bottom-color: #778899;
border-radius: 50%;
-webkit-animation: loader 2.5s linear infinite;
-moz-animation: loader 2.5s linear infinite;
-o-animation: loader 2.5s linear infinite;
animation: loader 3s linear infinite;
}
#loading-content:after {
border: 3px solid transparent;
border-top-color: #84417C;
border-bottom-color: #84417C;
border-radius: 50%;
-webkit-animation: loader 1s linear infinite;
animation: loader 1s linear infinite;
-moz-animation: loader 1.5s linear infinite;
-o-animation: loader 1.5s linear infinite;
}
#-webkit-keyframes loaders {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#keyframes loader {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
Transform: rotate (0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#content-wrapper {
color: #FFF;
position: fixed;
left: 0;
top: 20px;
width: 100%;
height: 100%;
}
#header
{
width: 800px;
margin: 0 auto;
text-align: center;
height: 100px;
background-color: #666;
}
#content
{
width: 800px;
height: 1000px;
margin: 0 auto;
text-align: center;
background-color: #888;
}
HTML
<div id="loading-wrapper">
<div id="loading-text">LOADING</div>
<div id="loading-content"></div>
</div>
So, I am trying to get my loading screen to be smaller so it doesn't take up so much of the page please. Thanks in advance!
Change the width, height, and margin inside #loading-content proportionally:
#loading-content {
width: 100px;
height: 100px;
margin: -50px 0 0 -50px;
}
Demo Snippet:
body {
background-color: #90EE90;
}
#loading-wrapper {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
#loading-text {
display: block;
position: absolute;
top: 100%;
left: 100%;
color: #999;
width: 100px;
height: 30px;
margin: -7px 0 0 -45px;
text-align: center;
font-family: 'PT Sans Narrow', sans-serif;
font-size: 20px;
}
#loading-content {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 100px;
height: 100px;
margin: -50px 0 0 -50px;
border: 3px solid #F00;
}
#loading-content:after {
content: "";
position: absolute;
border: 3px solid #0F0;
left: 15px;
right: 15px;
top: 15px;
bottom: 15px;
}
#loading-content:before {
content: "";
position: absolute;
border: 3px solid #00F;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
}
#loading-content {
border: 3px solid transparent;
border-top-color: #20B2AA;
border-bottom-color: #20B2AA;
border-radius: 50%;
-webkit-animation: loader 3.5s linear infinite;
-moz-animation: loader 3.5s linear infinite;
-o-animation: loader 3.5s linear infinite;
animation: loader 3.5s linear infinite;
}
#loading-content:before {
border: 3px solid transparent;
border-top-color: #778899;
border-bottom-color: #778899;
border-radius: 50%;
-webkit-animation: loader 2.5s linear infinite;
-moz-animation: loader 2.5s linear infinite;
-o-animation: loader 2.5s linear infinite;
animation: loader 3s linear infinite;
}
#loading-content:after {
border: 3px solid transparent;
border-top-color: #84417C;
border-bottom-color: #84417C;
border-radius: 50%;
-webkit-animation: loader 1s linear infinite;
animation: loader 1s linear infinite;
-moz-animation: loader 1.5s linear infinite;
-o-animation: loader 1.5s linear infinite;
}
#-webkit-keyframes loaders {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#keyframes loader {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
Transform: rotate (0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#content-wrapper {
color: #FFF;
position: fixed;
left: 0;
top: 20px;
width: 100%;
height: 100%;
}
#header
{
width: 800px;
margin: 0 auto;
text-align: center;
height: 100px;
background-color: #666;
}
#content
{
width: 800px;
height: 1000px;
margin: 0 auto;
text-align: center;
background-color: #888;
}
<div id="loading-wrapper">
<div id="loading-text">LOADING</div>
<div id="loading-content"></div>
</div>

Simple CSS spinner works as a DIV but not as a SPAN (or inline DIV)

I need a spinner that I can basically insert into the middle of paragraph text. I have the spinner the way I want it as a block-display element (div), but when I try to create it as a span (or change the div to be inline), the spinner doesn't work.
How can I modify this spinner so that it can be dropped into the middle of a sentence (i.e., paragraph text)?
#loader {
float: left;
width: 10px;
height: 10px;
margin-right: 5px;
margin-top: 2px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
#loaderInline {
display: inline;
width: 10px;
height: 10px;
margin-right: 5px;
margin-top: 2px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Add animation to "page content" */
.animate-bottom {
position: relative;
-webkit-animation-name: animatebottom;
-webkit-animation-duration: 1s;
animation-name: animatebottom;
animation-duration: 1s
}
#-webkit-keyframes animatebottom {
from {
bottom: -100px;
opacity: 0
}
to {
bottom: 0px;
opacity: 1
}
}
#keyframes animatebottom {
from {
bottom: -100px;
opacity: 0
}
to {
bottom: 0;
opacity: 1
}
}
<p>
<div id="loader"></div>Works as normal DIV
</p>
<p>
<div id="loaderInline"></div>Broken as DIV with inline display
</p>
inline element cannot be sized , inline-block, inline-flex or inline-table does and interact as an inline box.
#loader {
float: left;
width: 10px;
height: 10px;
margin-right: 5px;
margin-top: 2px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
#loaderInline {
display: inline-block;
width: 10px;
height: 10px;
margin-right: 5px;
margin-top: 2px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Add animation to "page content" */
.animate-bottom {
position: relative;
-webkit-animation-name: animatebottom;
-webkit-animation-duration: 1s;
animation-name: animatebottom;
animation-duration: 1s
}
#-webkit-keyframes animatebottom {
from {
bottom: -100px;
opacity: 0
}
to {
bottom: 0px;
opacity: 1
}
}
#keyframes animatebottom {
from {
bottom: -100px;
opacity: 0
}
to {
bottom: 0;
opacity: 1
}
}
<p>
<div id="loader"></div>Works as normal DIV
</p>
<p>
<div id="loaderInline"></div>Broken as DIV with inline display
</p>
You may as well use a pseudo :before/::before and inline-block:
#loader {
float: left;
width: 10px;
height: 10px;
margin-right: 5px;
margin-top: 2px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
p:before {
content: '';
display: inline-block;
width: 10px;
height: 10px;
margin-right: 5px;
margin-top: 2px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Add animation to "page content" */
.animate-bottom {
position: relative;
-webkit-animation-name: animatebottom;
-webkit-animation-duration: 1s;
animation-name: animatebottom;
animation-duration: 1s
}
#-webkit-keyframes animatebottom {
from {
bottom: -100px;
opacity: 0
}
to {
bottom: 0px;
opacity: 1
}
}
#keyframes animatebottom {
from {
bottom: -100px;
opacity: 0
}
to {
bottom: 0;
opacity: 1
}
}
<p>
an inline-block pseudo works too;
</p>

HTML, and CSS for Breaking news ticker

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/

Center Animated Object in iPad Safari Browser

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