Code has been added to clipboard!

HTML Progress Bar

Reading time 2 min
Published Jun 29, 2017
Updated Oct 3, 2019

HTML Progress Bar: Main Tips

  • Introduced in HTML5, progress element represents a certain ongoing task and might indicate its level of completion.
  • It works in a similar fashion to the HTML gauge.
  • HTML progress bars can be determinate or indeterminate.
  • The ending tag cannot be omitted.
  • You can easily style the progress bar with Bootstrap.

Tracking HTML Progress

The progress tags are used to specify an HTML progress bar:

Example
<p>Donuts eaten:</p>
<progress value="60" max="100"></progress>

Possible progress Tag Attributes

There are two optional attributes you can use with HTML5 progress bars: max and value.

The max attribute specifies total work required by the task. It must have a positive value (the default value is 1):

Example
<p>Ice cream devoured:</p>
<progress value="10" max="50"></progress>

The value attribute specifies how much of the task is completed. It must have a positive value that does not exceed max (or 1, if max is not specified):

Example
<p>Slushies slurped:</p>
<progress value="30" max="100"></progress>

Determinate or Not?

In the example below, you can see two HTML5 progress bars:

Example
<p>Fridge emptied:</p>
<progress value="30" max="100"></progress>

<p>Belly filled:</p>
<progress max="100"></progress>

The first one is determinate: it has the value specified and therefore shows the level of completion of the task.

The second bar has no value defined, which makes it indeterminate. That means it will only indicate that the action is still happening. However, it will not represent what part of it is completed and how much is still left to do.

Browser support

Chrome
6+
Edge
All
Firefox
6+
IE
10+
Opera
11+
Safari
6+

Mobile browser support

Chrome
All
Firefox
6+
Opera
11+
Safari
7+
Basics
Introduction
Syntax
Editors
Basic Examples
Head Section
<!DOCTYPE>
Tags and Elements
Semantic Elements
Tags Reference
Attributes
Comments
Block and Inline Elements
Forms
Form Elements
Input
Responsive Web Design
Inline Scripts
Uniform Resource Locator
Redirect
XHTML
Geolocation
Drag and Drop
Local Storage
Web Workers
Server-Sent Events
Character Encoding
Text Formatting
Quotation and Citation Elements
Headings
Paragraphs
Links
Tables
Lists
Symbols
Space
Tab
Styles
Computer Code
Layout
Classes
Colors
Images
iframes
Audio Player
Video Player
YouTube Videos
Multimedia
Canvas
SVG
<!-- -->
<a>
<abbr>
<acronym> DEPRECATED
<address>
<applet> DEPRECATED
<article>
<aside>
<audio>
<b>
<base>
<basefont> DEPRECATED
<bdi>
<bdo>
<big> DEPRECATED
<blink> DEPRECATED
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center> DEPRECATED
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir> DEPRECATED
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font> DEPRECATED
<footer>
<form>
<frame> DEPRECATED
<frameset> DEPRECATED
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen> DEPRECATED
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem> DEPRECATED
<meta>
<meter>
<nav>
<noframes> DEPRECATED
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike> DEPRECATED
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt> DEPRECATED
<u>
<ul>
<var>
<video>
<wbr>