HTML Tag Progress

Our goal is to illustrate Tag progress with examples in this post, in the hope that it will help you learn.

To show the progress of a task, HTML implements the tag <progress>.

Developers can simply add progress bars to their websites with this tool. Most often, it is used for displaying progress during file uploading.

Syntax:

<progress attributes…> </progress>

A progress bar can be shown by:

Example: 

<!DOCTYPE html> <html> <body> <label for="file">Downloading progress:</label> <progress id="file" value="40" max="100"> 40% </progress> </body> </html>

Here is another example of the progress tag:

Example: 

<!DOCTYPE html> <html> <body> <label for="file">Loading progress:</label> <progress id="file" value="20" max="100"> 20% </progress> </body> </html>

Progress bar Styling

The progress tag can be styled with CSS code.

Example: 

<!DOCTYPE html> <html> <head><style> progress{ width: 250px; height: 25px; } progress::-moz-progress-bar { background: blue; } progress::-webkit-progress-value { background: blue; } progress { color: blue; } </style> </head><body> <h1>The Progress Bar </h1> <label for="file">Loading progress:</label> <progress id="file" value="50" max="100"> 50% </progress> </body> </html>


Tag progress Usage

The Tag progress <progress> indicates the end-to-end progress of a task.

Advice: Make sure you add a label tag to your HTML for enhanced accessibility. Add the Tag progress <progress> in coordination with JavaScript to show a task’s progress.

Common Uses

Here are some common use cases for the <progress> tag:

  • The <progress> tag can be used to display the progress of a file upload, allowing the user to see how much of the file has been uploaded and how much remains.
  • The <progress> tag can be used to display the progress of a form submission, allowing the user to see how far along the process is and how much longer it will take.
  • The <progress> tag can be used to display the progress of a file download, allowing the user to see how much of the file has been downloaded and how much remains.
  • The <progress> tag can be used to display the progress of a video playback, allowing the user to see how far along they are in the video.
  • The <progress> tag can be used to display the progress of a game level or other in-game task, allowing the user to see how much they have completed and how much remains.
Important: Using a progress tag to display a gauge (for example, disk space usage) is not appropriate. To display a gauge, add a <meter> tag as a substitute.

Browser Compatibility

As indicated by the table numbers, the first version of the browser that is fully compatible with the element has been listed.

Element
<progress>8.010.016.06.011.0

Attributes list

ATTRIBUTEVALUEOverview
maxnumberDescribes how much work the task will require. It is set to 1 by default.
valuenumberDescribe how much work has been completed so far.
ididentifierIdentifies the progress element by its unique identifier.
classclassnamesCSS classes are assigned to the progress element.
styleCSS-stylesSpecify the style for the progress element.
data-*valueProvides JavaScript with additional data to work with.
hiddenhiddenSets the hidden status of the progress element.
titletextProvides a title that appears as a tooltip.

Attributes

Global

The Tag Progress <progress> in HTML is compatible with Global Attributes.

Event

The Tag Progress <progress> in HTML is compatible with Event Attributes as well.


HTML Tag Progress Advantages

Here are some advantages of using the <progress> tag:

  • The <progress> tag provides a visual representation of progress, making it easier for users to understand how much of a task has been completed and how much remains.
  • The <progress> tag is accessible to users with disabilities, such as those who use screen readers, because it provides a text description of the progress status.
  • The <progress> tag is flexible and can be used to display progress in a wide range of contexts, such as file downloads, form submissions, and other types of tasks.
  • The <progress> tag is supported by all modern browsers and devices, making it a reliable way to display progress information.
  • You can customize the appearance of the progress bar using CSS to suit the design of your website or application.
  • The <progress> tag can be used in conjunction with JavaScript to provide interactivity and additional functionality, such as the ability to cancel a task or update progress dynamically.
If this article somehow helped you in achieving your desired learning goal, then do leave your reaction below to encourage our efforts or to suggest us with some improvements for the betterment of this site.
We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *