I want to create a progress bar like in the below image:
I have no idea about creating this. Should I use HTML5 techniques?
Would you please give me some help about creating this progress bar?
A normal <div> element can be used for a progress bar. The CSS width property can be used to set the height and width of a progress bar.
Tip: Use the <progress> tag in conjunction with JavaScript to display the progress of a task. Note: The <progress> tag is not suitable for representing a gauge (e.g. disk space usage or relevance of a query result).
Make Structure Css and Html < div class="container" ></ div > : This the container will make wrapp the element inside. < ul class="progressbar" > : I will add < ul >< /ul > With class name progressbar. in the . container , I give the width 100% .
#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)
http://jsfiddle.net/cwZSW/1406/
#progress { background: #333; border-radius: 13px; height: 20px; width: 300px; padding: 3px; } #progress:after { content: ''; display: block; background: orange; width: 50%; height: 100%; border-radius: 9px; }
<div id="progress"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With