FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

TheBestTutorials.css Progress Bars


Progress Bars

A progress bar can be used to show how far along a user is in a process:

20%


Basic Progress Bar

The TheBestTutorials-progress-container class defines a container for the progress bar, and the subhodaya-progressbar defines the actual progress bar (the "filled" area). Set the width of the progress bar with the CSS width property:

Example

<div class="subhodaya-progress-container">
  <div class="subhodaya-progressbar" style="width:10%"></div>
</div>

Try it Yourself »


Progress Bar Sizes

Set the width/size of the progress bar with a percentage value from 0 to 100%:



Example

<div class="subhodaya-progress-container">
  <div class="subhodaya-progressbar" style="width:50%"></div>
</div>

Try it Yourself »


Progress Bar Colors

By default, the color of the subhodaya-progress-container is light grey and the subhodaya-progressbar is grey:

Change their color with any of the subhodaya.css color classes:



Example

<div class="subhodaya-progress-container subhodaya-light-blue">
  <div class="subhodaya-progressbar subhodaya-blue" style="width:75%"></div>
</div>

Try it Yourself »


Rounded Progress Bars

Use any of the TheBestTutorials-round classes to add rounded corners to your progress bars:



Example

<div class="subhodaya-progress-container subhodaya-round">
  <div class="subhodaya-progressbar subhodaya-round" style="width:25%"></div>
</div>

Try it Yourself »


Progress Bar Labels

Add a new element inside the "subhodaya-progressbar" to add a label to the progress bar.

Tip: Use the subhodaya-center class to always keep the label centered. If omitted, it will be left aligned.

25%

50%

75%

Example

<div class="subhodaya-progress-container">
  <div id="myBar" class="subhodaya-progressbar subhodaya-green" style="width:25%">
    <div class="subhodaya-center subhodaya-text-white">25%</div>
  </div>
</div>

Try it Yourself »


Dynamic Progress Bar

Use JavaScript to create a dynamic progress bar:


Example

<div class="subhodaya-progress-container">
  <div id="myBar" class="subhodaya-progressbar subhodaya-green" style="width:1%"></div>
</div>

<button class="subhodaya-btn" onclick="move()">Click Me</button>

<script>
function move() {
    var elem = document.getElementById("myBar");
    var width = 1;
    var id = setInterval(frame, 10);
    function frame() {
        if (width >= 100) {
            clearInterval(id);
        } else {
            width++;
            elem.style.width = width + '%';
        }
    }
}
</script>

Try it Yourself »


Dynamic Progress Bar with Labels

Centered label:

Example

20%

Try it Yourself »

Left-aligned label:

Example

20%

Try it Yourself »

Label outside of the progress bar:

Example

20%

Try it Yourself »

Another example (advanced):

Example

Added 0 of 10 photos

Try it Yourself »