CSS animation doesn't work outside codepen












-1














I built a basic holding page in codepen
https://codepen.io/smithandsuch/full/KGarVO/ and added some basic fade in animation but when uploading the same code to my website http://www.smithandsuch.com/ the animation doesn't work, I really have no idea why, can anyone help?



I know from experience codepen seems to be quite forgiving with poorly written code but I have linted the css and can't find any errors. I've also opened the CSS up into brackets to see if there was any faults and I couldn't find any in there either.






function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);

/*-----animation-----*/

.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
-moz-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@-moz-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}


* {
padding: 0;
margin: 0;
}


body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width:1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: flex;
justify-content: center;
/*align-items: center;*/
flex-direction: column;
}

footer {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/

@media screen and (min-width:375px) and (max-width:768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}

<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>












share|improve this question




















  • 1




    What animation isn't working? They look the same to me
    – j08691
    Nov 12 '18 at 21:36
















-1














I built a basic holding page in codepen
https://codepen.io/smithandsuch/full/KGarVO/ and added some basic fade in animation but when uploading the same code to my website http://www.smithandsuch.com/ the animation doesn't work, I really have no idea why, can anyone help?



I know from experience codepen seems to be quite forgiving with poorly written code but I have linted the css and can't find any errors. I've also opened the CSS up into brackets to see if there was any faults and I couldn't find any in there either.






function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);

/*-----animation-----*/

.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
-moz-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@-moz-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}


* {
padding: 0;
margin: 0;
}


body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width:1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: flex;
justify-content: center;
/*align-items: center;*/
flex-direction: column;
}

footer {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/

@media screen and (min-width:375px) and (max-width:768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}

<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>












share|improve this question




















  • 1




    What animation isn't working? They look the same to me
    – j08691
    Nov 12 '18 at 21:36














-1












-1








-1







I built a basic holding page in codepen
https://codepen.io/smithandsuch/full/KGarVO/ and added some basic fade in animation but when uploading the same code to my website http://www.smithandsuch.com/ the animation doesn't work, I really have no idea why, can anyone help?



I know from experience codepen seems to be quite forgiving with poorly written code but I have linted the css and can't find any errors. I've also opened the CSS up into brackets to see if there was any faults and I couldn't find any in there either.






function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);

/*-----animation-----*/

.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
-moz-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@-moz-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}


* {
padding: 0;
margin: 0;
}


body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width:1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: flex;
justify-content: center;
/*align-items: center;*/
flex-direction: column;
}

footer {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/

@media screen and (min-width:375px) and (max-width:768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}

<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>












share|improve this question















I built a basic holding page in codepen
https://codepen.io/smithandsuch/full/KGarVO/ and added some basic fade in animation but when uploading the same code to my website http://www.smithandsuch.com/ the animation doesn't work, I really have no idea why, can anyone help?



I know from experience codepen seems to be quite forgiving with poorly written code but I have linted the css and can't find any errors. I've also opened the CSS up into brackets to see if there was any faults and I couldn't find any in there either.






function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);

/*-----animation-----*/

.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
-moz-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@-moz-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}


* {
padding: 0;
margin: 0;
}


body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width:1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: flex;
justify-content: center;
/*align-items: center;*/
flex-direction: column;
}

footer {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/

@media screen and (min-width:375px) and (max-width:768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}

<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>








function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);

/*-----animation-----*/

.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
-moz-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@-moz-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}


* {
padding: 0;
margin: 0;
}


body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width:1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: flex;
justify-content: center;
/*align-items: center;*/
flex-direction: column;
}

footer {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/

@media screen and (min-width:375px) and (max-width:768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}

<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>





function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);

/*-----animation-----*/

.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
-moz-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@-moz-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}


* {
padding: 0;
margin: 0;
}


body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width:1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: flex;
justify-content: center;
/*align-items: center;*/
flex-direction: column;
}

footer {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/

@media screen and (min-width:375px) and (max-width:768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}

<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>






css3 css-animations






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 21:46









Johannes

36.6k102967




36.6k102967










asked Nov 12 '18 at 21:27









user3104672user3104672

43




43








  • 1




    What animation isn't working? They look the same to me
    – j08691
    Nov 12 '18 at 21:36














  • 1




    What animation isn't working? They look the same to me
    – j08691
    Nov 12 '18 at 21:36








1




1




What animation isn't working? They look the same to me
– j08691
Nov 12 '18 at 21:36




What animation isn't working? They look the same to me
– j08691
Nov 12 '18 at 21:36












1 Answer
1






active

oldest

votes


















0














can you confirm that you've linked the CSS files? I loaded everything you have and it looks exactly the same as the codepen.



Uploading my code so that you can see what differs from both of ours.



        <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<meta name="description" content="Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London. I design modern intuitive websites with a focus on good UX design."/>
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="https://use.typekit.net/fxo7lqf.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FitText.js/1.1/jquery.fittext.min.js"></script>
<script>

function update() {
$('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
}

setInterval(update, 1000);</script>
</head>
<body>
<header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
</header>
<div class="hero">
<h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
</div>
<footer>
<h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
<h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
</footer>
</body>
</html>
//css in a sheet called main.css
.fade-in {
-webkit-animation: fade-in 1s ease-in-out 0.9s both;
animation: fade-in 1s ease-in-out 0.9s both;
}

@-webkit-keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

* {
padding: 0;
margin: 0;
}

body {
margin: 10px 20px;
background: #f8f8f8f8;
min-width: 375px;
}

h1, h2, h3, h4, h5, h6 {
font-family: "futura-pt";
font-weight: 600;
font-style: normal;
color: #0b1c26;
text-align: left;
opacity: 1;
}

.h1-hero {
max-width: 1440px;
font-size: 4.4em;
margin: auto;
padding-bottom: 2em;
opacity: 1;
}

h2 {
font-size: 2.4em;
}

h3 {
font-size: 1.4em;
}

a {
color: #0b1c26;
}

header {
height: 60px;
}

.hero {
height: calc(100vh - 140px);
width: 100vw;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
/*align-items: center;*/
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}

footer {
height: 60px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}

.red {
color: #FF5733;
}

/*-----media queries-----*/
@media screen and (min-width: 375px) and (max-width: 768px) {
body {
margin: 10px 10px;
}
.h1-hero {
font-size: 2em;
max-width: 768px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.h3-today {
display: none;
}
body {
overflow: hidden;
}
}





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53270361%2fcss-animation-doesnt-work-outside-codepen%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    can you confirm that you've linked the CSS files? I loaded everything you have and it looks exactly the same as the codepen.



    Uploading my code so that you can see what differs from both of ours.



            <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <meta name="description" content="Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London. I design modern intuitive websites with a focus on good UX design."/>
    <link rel="stylesheet" href="main.css">
    <link rel="stylesheet" href="https://use.typekit.net/fxo7lqf.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/FitText.js/1.1/jquery.fittext.min.js"></script>
    <script>

    function update() {
    $('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
    }

    setInterval(update, 1000);</script>
    </head>
    <body>
    <header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
    </header>
    <div class="hero">
    <h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
    </div>
    <footer>
    <h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
    <h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
    </footer>
    </body>
    </html>
    //css in a sheet called main.css
    .fade-in {
    -webkit-animation: fade-in 1s ease-in-out 0.9s both;
    animation: fade-in 1s ease-in-out 0.9s both;
    }

    @-webkit-keyframes fade-in {
    0% {
    opacity: 0;
    }
    100% {
    opacity: 1;
    }
    }

    @keyframes fade-in {
    0% {
    opacity: 0;
    }
    100% {
    opacity: 1;
    }
    }

    * {
    padding: 0;
    margin: 0;
    }

    body {
    margin: 10px 20px;
    background: #f8f8f8f8;
    min-width: 375px;
    }

    h1, h2, h3, h4, h5, h6 {
    font-family: "futura-pt";
    font-weight: 600;
    font-style: normal;
    color: #0b1c26;
    text-align: left;
    opacity: 1;
    }

    .h1-hero {
    max-width: 1440px;
    font-size: 4.4em;
    margin: auto;
    padding-bottom: 2em;
    opacity: 1;
    }

    h2 {
    font-size: 2.4em;
    }

    h3 {
    font-size: 1.4em;
    }

    a {
    color: #0b1c26;
    }

    header {
    height: 60px;
    }

    .hero {
    height: calc(100vh - 140px);
    width: 100vw;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    /*align-items: center;*/
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    }

    footer {
    height: 60px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    }

    .red {
    color: #FF5733;
    }

    /*-----media queries-----*/
    @media screen and (min-width: 375px) and (max-width: 768px) {
    body {
    margin: 10px 10px;
    }
    .h1-hero {
    font-size: 2em;
    max-width: 768px;
    }
    h2 {
    font-size: 1.5em;
    }
    h3 {
    font-size: 1.2em;
    }
    .h3-today {
    display: none;
    }
    body {
    overflow: hidden;
    }
    }





    share|improve this answer


























      0














      can you confirm that you've linked the CSS files? I loaded everything you have and it looks exactly the same as the codepen.



      Uploading my code so that you can see what differs from both of ours.



              <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>Document</title>
      <meta name="description" content="Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London. I design modern intuitive websites with a focus on good UX design."/>
      <link rel="stylesheet" href="main.css">
      <link rel="stylesheet" href="https://use.typekit.net/fxo7lqf.css">
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/FitText.js/1.1/jquery.fittext.min.js"></script>
      <script>

      function update() {
      $('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
      }

      setInterval(update, 1000);</script>
      </head>
      <body>
      <header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
      </header>
      <div class="hero">
      <h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
      </div>
      <footer>
      <h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
      <h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
      </footer>
      </body>
      </html>
      //css in a sheet called main.css
      .fade-in {
      -webkit-animation: fade-in 1s ease-in-out 0.9s both;
      animation: fade-in 1s ease-in-out 0.9s both;
      }

      @-webkit-keyframes fade-in {
      0% {
      opacity: 0;
      }
      100% {
      opacity: 1;
      }
      }

      @keyframes fade-in {
      0% {
      opacity: 0;
      }
      100% {
      opacity: 1;
      }
      }

      * {
      padding: 0;
      margin: 0;
      }

      body {
      margin: 10px 20px;
      background: #f8f8f8f8;
      min-width: 375px;
      }

      h1, h2, h3, h4, h5, h6 {
      font-family: "futura-pt";
      font-weight: 600;
      font-style: normal;
      color: #0b1c26;
      text-align: left;
      opacity: 1;
      }

      .h1-hero {
      max-width: 1440px;
      font-size: 4.4em;
      margin: auto;
      padding-bottom: 2em;
      opacity: 1;
      }

      h2 {
      font-size: 2.4em;
      }

      h3 {
      font-size: 1.4em;
      }

      a {
      color: #0b1c26;
      }

      header {
      height: 60px;
      }

      .hero {
      height: calc(100vh - 140px);
      width: 100vw;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      justify-content: center;
      /*align-items: center;*/
      -webkit-box-orient: vertical;
      -webkit-box-direction: normal;
      -ms-flex-direction: column;
      flex-direction: column;
      }

      footer {
      height: 60px;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-align: center;
      -ms-flex-align: center;
      align-items: center;
      -webkit-box-pack: justify;
      -ms-flex-pack: justify;
      justify-content: space-between;
      }

      .red {
      color: #FF5733;
      }

      /*-----media queries-----*/
      @media screen and (min-width: 375px) and (max-width: 768px) {
      body {
      margin: 10px 10px;
      }
      .h1-hero {
      font-size: 2em;
      max-width: 768px;
      }
      h2 {
      font-size: 1.5em;
      }
      h3 {
      font-size: 1.2em;
      }
      .h3-today {
      display: none;
      }
      body {
      overflow: hidden;
      }
      }





      share|improve this answer
























        0












        0








        0






        can you confirm that you've linked the CSS files? I loaded everything you have and it looks exactly the same as the codepen.



        Uploading my code so that you can see what differs from both of ours.



                <!DOCTYPE html>
        <html lang="en">
        <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <meta name="description" content="Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London. I design modern intuitive websites with a focus on good UX design."/>
        <link rel="stylesheet" href="main.css">
        <link rel="stylesheet" href="https://use.typekit.net/fxo7lqf.css">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/FitText.js/1.1/jquery.fittext.min.js"></script>
        <script>

        function update() {
        $('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
        }

        setInterval(update, 1000);</script>
        </head>
        <body>
        <header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
        </header>
        <div class="hero">
        <h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
        </div>
        <footer>
        <h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
        <h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
        </footer>
        </body>
        </html>
        //css in a sheet called main.css
        .fade-in {
        -webkit-animation: fade-in 1s ease-in-out 0.9s both;
        animation: fade-in 1s ease-in-out 0.9s both;
        }

        @-webkit-keyframes fade-in {
        0% {
        opacity: 0;
        }
        100% {
        opacity: 1;
        }
        }

        @keyframes fade-in {
        0% {
        opacity: 0;
        }
        100% {
        opacity: 1;
        }
        }

        * {
        padding: 0;
        margin: 0;
        }

        body {
        margin: 10px 20px;
        background: #f8f8f8f8;
        min-width: 375px;
        }

        h1, h2, h3, h4, h5, h6 {
        font-family: "futura-pt";
        font-weight: 600;
        font-style: normal;
        color: #0b1c26;
        text-align: left;
        opacity: 1;
        }

        .h1-hero {
        max-width: 1440px;
        font-size: 4.4em;
        margin: auto;
        padding-bottom: 2em;
        opacity: 1;
        }

        h2 {
        font-size: 2.4em;
        }

        h3 {
        font-size: 1.4em;
        }

        a {
        color: #0b1c26;
        }

        header {
        height: 60px;
        }

        .hero {
        height: calc(100vh - 140px);
        width: 100vw;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        /*align-items: center;*/
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        }

        footer {
        height: 60px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        }

        .red {
        color: #FF5733;
        }

        /*-----media queries-----*/
        @media screen and (min-width: 375px) and (max-width: 768px) {
        body {
        margin: 10px 10px;
        }
        .h1-hero {
        font-size: 2em;
        max-width: 768px;
        }
        h2 {
        font-size: 1.5em;
        }
        h3 {
        font-size: 1.2em;
        }
        .h3-today {
        display: none;
        }
        body {
        overflow: hidden;
        }
        }





        share|improve this answer












        can you confirm that you've linked the CSS files? I loaded everything you have and it looks exactly the same as the codepen.



        Uploading my code so that you can see what differs from both of ours.



                <!DOCTYPE html>
        <html lang="en">
        <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <meta name="description" content="Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London. I design modern intuitive websites with a focus on good UX design."/>
        <link rel="stylesheet" href="main.css">
        <link rel="stylesheet" href="https://use.typekit.net/fxo7lqf.css">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/FitText.js/1.1/jquery.fittext.min.js"></script>
        <script>

        function update() {
        $('#clock').html(moment().format('ddd DD MMM YYYY H:mm'));
        }

        setInterval(update, 1000);</script>
        </head>
        <body>
        <header><h2 class="fade-in">&AMP;<span class="red">.</span></h2>
        </header>
        <div class="hero">
        <h1 class="h1-hero fade-in">Hi, I'm Andrew a Freelance Web designer and Front-End Developer based in London<span class="red">.</span><br>I design modern intuitive websites with a focus on good UX design<span class="red">.</span></h1>
        </div>
        <footer>
        <h3 class="h3-today fade-in"><span id="clock">Today I'm...</span> | Coding: <a href="http://wink.smithandsuch.com/" target="_blank">wink</a> | Watching: <a href="https://www.youtube.com/watch?v=L6cDDmk-O5A" target="_blank">Maniac</a> | Listening: <a href="https://www.youtube.com/watch?v=aamiinOWLhI" target="_blank">Surfbort - Hippie Vomit Inhaler</a></h3>
        <h3 class="fade-in">Contact: <u>andrew@smithandsuch.com</u></h3>
        </footer>
        </body>
        </html>
        //css in a sheet called main.css
        .fade-in {
        -webkit-animation: fade-in 1s ease-in-out 0.9s both;
        animation: fade-in 1s ease-in-out 0.9s both;
        }

        @-webkit-keyframes fade-in {
        0% {
        opacity: 0;
        }
        100% {
        opacity: 1;
        }
        }

        @keyframes fade-in {
        0% {
        opacity: 0;
        }
        100% {
        opacity: 1;
        }
        }

        * {
        padding: 0;
        margin: 0;
        }

        body {
        margin: 10px 20px;
        background: #f8f8f8f8;
        min-width: 375px;
        }

        h1, h2, h3, h4, h5, h6 {
        font-family: "futura-pt";
        font-weight: 600;
        font-style: normal;
        color: #0b1c26;
        text-align: left;
        opacity: 1;
        }

        .h1-hero {
        max-width: 1440px;
        font-size: 4.4em;
        margin: auto;
        padding-bottom: 2em;
        opacity: 1;
        }

        h2 {
        font-size: 2.4em;
        }

        h3 {
        font-size: 1.4em;
        }

        a {
        color: #0b1c26;
        }

        header {
        height: 60px;
        }

        .hero {
        height: calc(100vh - 140px);
        width: 100vw;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        /*align-items: center;*/
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        }

        footer {
        height: 60px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        }

        .red {
        color: #FF5733;
        }

        /*-----media queries-----*/
        @media screen and (min-width: 375px) and (max-width: 768px) {
        body {
        margin: 10px 10px;
        }
        .h1-hero {
        font-size: 2em;
        max-width: 768px;
        }
        h2 {
        font-size: 1.5em;
        }
        h3 {
        font-size: 1.2em;
        }
        .h3-today {
        display: none;
        }
        body {
        overflow: hidden;
        }
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 21:40









        Robert PerezRobert Perez

        1179




        1179






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53270361%2fcss-animation-doesnt-work-outside-codepen%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()