I'm trying to make a simple css progress bar for one of my projects; however, it seems the span element is only the width of the text inside of it, even when I set its width. How can I go about this issue, and have it stretch accordingly?
(if words don't do that justice: http://puu.sh/61Zmn.png)
Here's what I got so far:
<html>
<head>
<style>
.bar {
padding:0;
width:300px;
border:1px solid blue;
overflow:hidden;
}
.bar span {
padding:0;
margin:0;
height:100%;
color:white;
text-align:center;
background-color:red;
border:1px solid red;
}
</style>
</head>
<body>
<div class="bar">
<span style="width:64%;">64%</span>
</div>