HTML5 Progress Label How do I change the color of a progress bar? Progress progress Bar Detailed

Source: Internet
Author: User
This article describes the style resolution for the new Progress progress bar label in HTML5, explaining how to change the color of the progress bar by HTML5 the progress tag. Let's take a look at this article next.

First, let's get to know the HTML5 Progress label Introduction:

Progress is a new element of HTML5 that defines a progress bar, which can be used in the progress display of file uploads, the progress of file downloads, or as a loading loading status bar.

Tip: Use the <progress> tag with JavaScript to show the progress of your task.

Note:<progress> tags are not suitable for measuring weights (for example, disk space usage or query results). To represent weights and measures, use the <meter> tag instead.

HTML5 Progress progress bar Syntax:

<progress value= ' max= ' ></progress>

Let's prepare an example of a HTML5 progress tag:


Explanation, the progress is rendered in the Chrome browser in the following structure

Progress

:-webkit-progress-bar All Progress

:-webkit-progress-value has completed progress

The two pseudo-elements are added to the style.

However, in other browsers, such as IE10, these two pseudo-elements do not work, directly with the color style can modify the completed progress of the colors, and the overall progress is background

In Firefox, Progress-bar is the complete progress, background is the full progress, and opera in this style can only be the browser default style.

So the compatibility wording can be considered as follows:

progress{   color:orange;/* Compatible with IE10 completed progress background */   border:none;   Background: #d7d7d7;/* This property can also be used as Chrome's completed progress background, but is covered by the following::p Rogress-bar */      }progress::-webkit-progress-bar{   background: #d7d7d7;} progress::-webkit-progress-value,progress::-moz-progress-bar{     Background:orange;}

The above is the code about the color CSS style of the progress bar, which shows the following effects:

Well, the above is about the new HTML5 in the use of progress tags, change the color of the article, there are questions can be asked below.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.