How to change the color of a progress bar

2019-03-01 00:28发布

问题:

I want to change the color of the last update text, by default it is black , is there a way to introduce some code to change the text color as i made for the bar text? Help me to introduce the code that is missing.

<div id="progress">
    <span id="percent">2%</span>
    <div id="bar"></div>
    </div>
Last updated: 7/01/2013
#progress{
 width: 500px;   
 border: 1px solid orange;
 position: relative;
 padding: 1px;
}

#percent {
 position: absolute;   
 left: 50%;
 color:#C3B004; 
}

#bar {
 height: 20px;
 background-color:#2CB032;
 width: 2%;
}

Here is the link for the bar : link

回答1:

I assume you can wrap the Last updated: 7/01/2013 in <span> tags, and give it a class, then you can style it however you want.

<span class="updated">Last updated: 7/01/2013</span>

CSS:

.updated {
    font-size: 12px;    //size
    color: green;       //colour
    font-family:"Arial" //font 
}