How to Create a Dot loading Animation using HTML and CSS? Last Updated : 14 Aug, 2020 Comments Improve Suggest changes Like Article Like Report The Dot Loading animation can be used to enhance the user interface of a website, it can be added while the website loads. This animation can be easily created using HTML and CSS. HTML Code: In this section we will create the basic structure of the dot loader using a div tag which will have some span tags inside of it. html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dots Loading Animation</title> </head> <style> <body> <div class="loader"> <span></span> <span ></span> <span ></span> <span ></span> <span></span> <span></span> </div> </body> </html> CSS Code: In this section first we will create the dots structure using some basic CSS properties and then in order to create the animation we will use @keyframes rule and use the transformX() function to produce the desired effect. html <style> body{ margin: 0; padding: 0; } .loader{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; } /* Creating the dots */ span{ height: 25px; width: 25px; margin-right: 10px; border-radius: 50%; background-color: green; animation: loading 1s linear infinite; } /* Creating the loading animation*/ @keyframes loading { 0%{ transform: translateX(0); } 25%{ transform: translateX(15px); } 50%{ transform: translateX(-15px); } 100%{ transform: translateX(0); } } span:nth-child(1){ animation-delay: 0.1s; } span:nth-child(2){ animation-delay: 0.2s; } span:nth-child(3){ animation-delay: 0.3s; } span:nth-child(4){ animation-delay: 0.4s; } span:nth-child(5){ animation-delay: 0.5s; } </style> Complete Code: It is the combination of the above two code sections. html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dots loading animation</title> </head> <style> body{ margin: 0; padding: 0; } .loader{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; } /* Creating the dots */ span{ height: 25px; width: 25px; margin-right: 10px; border-radius: 50%; background-color: green; animation: loading 1s linear infinite; } /* Creating the loading animation*/ @keyframes loading { 0%{ transform: translateX(0); } 25%{ transform: translateX(15px); } 50%{ transform: translateX(-15px); } 100%{ transform: translateX(0); } } span:nth-child(1){ animation-delay: 0.1s; } span:nth-child(2){ animation-delay: 0.2s; } span:nth-child(3){ animation-delay: 0.3s; } span:nth-child(4){ animation-delay: 0.4s; } span:nth-child(5){ animation-delay: 0.5s; } </style> <body> <div class="loader"> <span></span> <span ></span> <span ></span> <span ></span> <span></span> <span></span> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article How to Create a Dot loading Animation using HTML and CSS? L lakshgoel204 Follow Improve Article Tags : Web Technologies Web Templates Similar Reads How to Create Animated Loader Ring using HTML and CSS? An Animated Loader Ring using HTML and CSS is a circular loading animation that visually indicates progress or loading status. It is created with a simple HTML structure and animated using CSS properties like border, transform, and @keyframes for rotation effects.ApproachHTML Structure: The code use 2 min read How to Create Loading Blur Text Animation Effect using HTML and CSS? The blur text animation is known as the Smoky effect and is used to give the text a blurry animation. The text blurs linearly in one direction and then reappears. In this article, we will create a loading blur text animation effect using HTML and CSS.Approach: The approach to create loading blur tex 3 min read How to create a progress bar animation using HTML and CSS ? In this mini Web Development project we will utilize CSS animations and create a progress bar using them. The progress bar will start from zero and go to a certain extent as we want. The progress bar is basically showing the expertise of a programmer in different languages in animated form. Prerequi 3 min read How to Create Animation Loading Bar using CSS ? Loading Bar with animation can be created using HTML and CSS. We will create a Loader that is the part of an operating system that is responsible for loading programs and libraries. The progress bar is a graphical control element used to visualize the progression of an extended computer operation, s 3 min read How to create a animated pill shaped button using HTML and CSS ? Most mobile applications and websites have some eye-catching animation that tries to grab the attention of the user, these animations trigger some event fire or on an infinite loop, website events are triggered on mouse clicks or mouse hovers while on mobile touch events or infinite loop is activate 4 min read Like