top of page

How to create a fade in transition when your website loads

Writer: Web Coding
Web Coding
Dec 24, 2020
1 min read

Today I will be teaching you how to create a fade in transition when your website loads


HTML

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <title>Document</title>
 <link rel="stylesheet" href="style.css">
</head>
<body>
 <p>subscribe</p>
</body>
</html>

CSS

*{
 padding: 0;
 margin: 0;
}

body{
 min-height: 100vh;
 display: flex;
 align-items: center;
 justify-content: center;
 background: #201e20;
}

p{
 font-size: 0px;
 opacity: 0;
 text-transform: uppercase;
 color: #e0a96d;
 animation-name: fadeIn;
 animation-duration: 1.5s;
 animation-timing-function: linear;
 animation-fill-mode: forwards;
}

@keyframes fadeIn{
    0% {}
    60% {font-size: 80px; opacity: 1;}
    100% {font-size: 64px; opacity: 1;}
}

If you found this blog post helpful don’t forget to check out my other projects and if you want more content follow me on


YouTube: https://www.youtube.com/channel/UC2nxqB2usQIS2c8zwVZKWEQ

Instagram: https://www.instagram.com/coding_for_the_web/

Twitter: https://twitter.com/LearnWebCoding

 
 
 

Comments


  • YouTube
  • Instagram

©2020 by Web Coding. Proudly created with Wix.com

bottom of page