Progress Bar with HTML and CSS

Shahin picture Shahin · Aug 25, 2011 · Viewed 174.2k times · Source

I want to create a progress bar like in the below image:

Progress Bar Example

I have no idea about creating this. Should I use HTML5 techniques?

Would you please give me some help about creating this progress bar?

Answer

RoToRa picture RoToRa · Aug 25, 2011

#progressbar {
  background-color: black;
  border-radius: 13px;
  /* (height of inner div) / 2 + padding */
  padding: 3px;
}

#progressbar>div {
  background-color: orange;
  width: 40%;
  /* Adjust with JavaScript */
  height: 20px;
  border-radius: 10px;
}
<div id="progressbar">
  <div></div>
</div>

Fiddle

(EDIT: Changed Syntax highlight; changed descendant to child selector)