The <progress> HTML Tag
Welcome to the first article in the Uncommon HTML Tags series! The <progress> tag will create a progress bar and allow you to visualize the completion of a task. Let's take a look at how it's used!
January 5, 2021 (4y ago)
2 min read
Welcome to the first article in the Uncommon HTML Tags series! With each article in this series, I will introduce a widely unknown HTML tag, discuss compatibility across browsers and cover some real-world use cases with the element.
My hope is that each article broadens your understanding of HTML and helps you discover new tags.
The < progress > Tag
The <progress></progress>
tag will create a progress bar and allow you to visualize the completion of a task. This could be handy for showing the progress completion of a multi-page feedback survey, for example!
Let's take a look at how it's used!
<label for="progress">Article Progress:</label> <progress id="progress" max="100" value="50">50%</progress>
As seen in the example above, there are two attributes you can use on the element.
-
max
- this attribute, if used, is a floating point number and must have a value greater than0
. -
value
- this optional attribute is used to determine the completion of a task and must be a floating point number between0
and the number set in themax
attribute. If thevalue
attribute is omitted, the progress bar is set to an indeterminate state.
Here is an example of an indeterminate progress bar:
<label for="progress">Article Progress:</label> <progress id="progress" max="100"></progress>
If you want to play around with the tag, feel free to fork the pen below!
Compatibility
The <progress></progress>
tag is part of the HTML5 Standard and is supported on all major web browsers. No need to worry about compatibility issues!
Conclusion
Have you ever used the <progress></progress>
tag in a project? Hit me up on Twitter and let me know!
Thanks for reading! If you liked this article and want more content like this, read some of my other articles and make sure to follow me on Twitter!
Here are some other articles you might find interesting.
Tailwind Gradients - How to Make a Glowing Gradient Background
In this article, you’ll learn all about Tailwind gradients and how to create the popular glowing gradient effect.
Maximize Component Reusability with Bit
We put so much emphasis on component reusability inside a project, why are we not putting as much emphasis on component shareability?