adc

clicks

simple text animation in html and css | text animation html css

 An animation lets an element gradually change from one style to another. You can change as many CSS properties you want, as many times you want. To use CSS animation, you must first specify some keyframes for the animation. Keyframes hold what styles the element will have at certain times.An animation lets an element gradually change from one style to another. You can change as many CSS properties you want, as many times you want. To use CSS animation, you must first specify some keyframes for the animation. Keyframes hold what styles the element will have at certain times.

 

 
HTML
Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.
After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.


<html>

<head>

               <title>simple text  animation </title>

               <link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>

               <div class="text">

                              <h2>EasyCoding</h2>

                              <h1></h1>

               </div>

</body>

</html>


CSS


Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.


body{

                    background-image: url(pic.jpg);

                    background-repeat: no-repeat;

                    background-position: center center;

                    -webkit-background-size:cover;

                    background-size:cover;

                    height: 100vh;

}

.text{

                    position: absolute;

                    top: 50%;

                    left: 50%;

                   

                    transform: translate(-50%, -50%);

                    text-align: center;

}

.text h2{

                    font-size:85px;

                    font-family: merlenda;

                    margin: 0;

                    color: white;

                    padding-left:500px;

}

 

h1{

                    font-family: sans-serif;

                    margin: 0;

 

}

h1:before{

                    content: 'Share and  Subscribe';

                    font-size: 400%;

                    color: white;

                    padding-left:300px;

                    animation: animate 10s infinite;

}

@keyframes animate{

                    0%{

                                        font-size: 400%;

                                        opacity: 1;

                    }

                    20%{

                                        font-size: 350%;

                                        opacity: 0;

                    }

                    40%{

                                        font-size: 400%;

                                        opacity: 1;

                    }

                    60%{

                                        font-size: 350%;

                                        opacity: 0;

                    }

                    80%{

                                        font-size: 400%;

                                        opacity: 1;

                                        padding-left:300px;

                                        content:'Front-End Tutorial';

                    }

                    100%{

                                        font-size: 350%;

                                        opacity: 0;

                    }

}

 

 Source Code

 

Watch Videos

 

Youtube Channel 

 

 

 

 

 

 

 

 

 

 

simple text animation in html and css | text animation html css simple text animation in html and css |  text animation html css Reviewed by easycoding on August 21, 2020 Rating: 5

No comments:

Powered by Blogger.