How to Create Animation Loading Bar using CSS ? Last Updated : 09 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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, so here we use the progress bar as an animation in loader. We will create a loading bar using HTML and CSS properties. HTML Code: In this section, we will design the basic structure of the HTML code. html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content= "width=device-width, initial-scale=1.0"> <title>Loader Bar</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="loader"> <div class="loading_1"></div> <div class="loading_2">Loading GfG...</div> </div> </body> </html> CSS Code: In this section, we will use some CSS property to design the loading bar. We will use @keyframes which specifies animation code. The animation is created by gradually changing from one set of CSS styles to another. The changes in styles happen in percent using the keywords "from" (0%) and "to" (100%). We can change the set of CSS styles many times. CSS <style> body { background-color: #262626; font-family: Lato, sans-serif; } .loader { width: 150px; margin: 150px auto 70px; position: relative; } .loader .loading_1 { position: relative; width: 100%; height: 10px; border: 1px solid yellowgreen; border-radius: 10px; animation: turn 4s linear 1.75s infinite; } .loader .loading_1:before { content: ""; display: block; position: absolute; width: 0; height: 100%; background-color: yellowgreen; box-shadow: 10px 0px 15px 0px yellowgreen; animation: load 2s linear infinite; } .loader .loading_2 { position: absolute; width: 100%; top: 10px; color: green; font-size: 22px; text-align: center; animation: bounce 2s linear infinite; } @keyframes load { 0% { width: 0%; } 87.5% { width: 100%; } } @keyframes turn { 0% { transform: rotateY(0deg); } 6.25%, 50% { transform: rotateY(180deg); } 56.25%, 100% { transform: rotateY(360deg); } } @keyframes bounce { 0%, 100% { top: 10px; } 12.5% { top: 30px; } } </style> Complete Code: It is the combination of above two code section of HTML and CSS. In the following code, we have added the CSS code internally in the HTML code. html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content= "width=device-width, initial-scale=1.0"> <title>Loader Bar</title> <style> body { background-color: #262626; font-family: Lato, sans-serif; } .loader { width: 150px; margin: 150px auto 70px; position: relative; } .loader .loading_1 { position: relative; width: 100%; height: 10px; border: 1px solid yellowgreen; border-radius: 10px; animation: turn 4s linear 1.75s infinite; } .loader .loading_1:before { content: ""; display: block; position: absolute; width: 0; height: 100%; background-color: yellowgreen; box-shadow: 10px 0px 15px 0px yellowgreen; animation: load 2s linear infinite; } .loader .loading_2 { position: absolute; width: 100%; top: 10px; color: green; font-size: 22px; text-align: center; animation: bounce 2s linear infinite; } @keyframes load { 0% { width: 0%; } 87.5% { width: 100%; } } @keyframes turn { 0% { transform: rotateY(0deg); } 6.25%, 50% { transform: rotateY(180deg); } 56.25%, 100% { transform: rotateY(360deg); } } @keyframes bounce { 0%, 100% { top: 10px; } 12.5% { top: 30px; } } </style> </head> <body> <div class="loader"> <div class="loading_1"></div> <div class="loading_2">Loading GfG...</div> </div> </body> </html> Output: The following image shows the loading bar with animation. Comment More infoAdvertise with us N nehaahlawat Follow Improve Article Tags : Web Technologies CSS Write From Home CSS-Questions Similar Reads JavaScript Tutorial JavaScript is a programming language used to create dynamic content for websites. It is a lightweight, cross-platform, and single-threaded programming language. It's an interpreted language that executes code line by line, providing more flexibility.JavaScript on Client Side: On the client side, Jav 11 min read Web Development Web development is the process of creating, building, and maintaining websites and web applications. It involves everything from web design to programming and database management. Web development is generally divided into three core areas: Frontend Development, Backend Development, and Full Stack De 5 min read React Interview Questions and Answers React is an efficient, flexible, and open-source JavaScript library that allows developers to create simple, fast, and scalable web applications. Jordan Walke, a software engineer who was working for Facebook, created React. Developers with a JavaScript background can easily develop web applications 15+ min read React Tutorial React is a powerful JavaScript library for building fast, scalable front-end applications. Created by Facebook, it's known for its component-based structure, single-page applications (SPAs), and virtual DOM,enabling efficient UI updates and a seamless user experience.Note: The latest stable version 7 min read JavaScript Interview Questions and Answers JavaScript is the most used programming language for developing websites, web servers, mobile applications, and many other platforms. In Both Front-end and Back-end Interviews, JavaScript was asked, and its difficulty depends upon the on your profile and company. Here, we compiled 70+ JS Interview q 15+ min read Domain Name System (DNS) DNS is a hierarchical and distributed naming system that translates domain names into IP addresses. When you type a domain name like www.geeksforgeeks.org into your browser, DNS ensures that the request reaches the correct server by resolving the domain to its corresponding IP address.Without DNS, w 8 min read HTML Interview Questions and Answers HTML (HyperText Markup Language) is the foundational language for creating web pages and web applications. Whether you're a fresher or an experienced professional, preparing for an HTML interview requires a solid understanding of both basic and advanced concepts. Below is a curated list of 50+ HTML 14 min read NodeJS Interview Questions and Answers NodeJS is one of the most popular runtime environments, known for its efficiency, scalability, and ability to handle asynchronous operations. It is built on Chromeâs V8 JavaScript engine for executing JavaScript code outside of a browser. It is extensively used by top companies such as LinkedIn, Net 15+ min read What is DFD(Data Flow Diagram)? Data Flow Diagram is a visual representation of the flow of data within the system. It help to understand the flow of data throughout the system, from input to output, and how it gets transformed along the way. The models enable software engineers, customers, and users to work together effectively d 9 min read What is an API (Application Programming Interface) In the tech world, APIs (Application Programming Interfaces) are crucial. If you're interested in becoming a web developer or want to understand how websites work, you'll need to familiarize yourself with APIs. Let's break down the concept of an API in simple terms.What is an API?An API is a set of 10 min read Like