Open In App

How to create a progress bar using HTML and CSS?

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

The progress bar is an important element in the web, the progress bar can be used for downloading, marks obtained, skill measuring unit, etc. To create a progress bar we can use HTML and CSS. To make that progress bar responsive you will need JavaScript.In this article, we will learn to create progress bars using HTML and CSS.

Refer: How to Create Progress Bar using JavaScript?

Approach:

  • Start with HTML structure, using divs for each skill, and semantic tags for title and skill names.
  • Create containers with background color, width, and border radius for each skill.
  • Inside containers, define progress bars with customized styles.
  • Apply specific widths using classes like “html” and “php” to represent skill levels.
  • Use CSS to style HTML elements, including font size for ‘<p>’ tags and styles for containers and progress bars.

Example:

html




<!DOCTYPE html>
<html>
  
<head>
    <style>
        p {
            font-size: 20px;
        }
  
        .container {
            background-color: rgb(192, 192, 192);
            width: 80%;
            border-radius: 15px;
        }
  
        .skill {
            background-color: rgb(116, 194, 92);
            color: white;
            padding: 1%;
            text-align: right;
            font-size: 20px;
            border-radius: 15px;
        }
  
        .html {
            width: 80%;
        }
  
        .php {
            width: 60%;
        }
    </style>
</head>
  
<body>
    <h1>My Skills</h1>
    <p>HTML</p>
    <div class="container">
        <div class="skill html">80%</div>
    </div>
  
    <p>PHP</p>
    <div class="container">
        <div class="skill php">60%</div>
    </div>
</body>
  
</html>


Output:



Last Updated : 12 Jan, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads