My solution works with and without float: left
.
HTML:
css:
div {
height: 20px;
background: black;
float: left;
width: 100%;
padding-right: 50px;
box-sizing: border-box;
background-clip: content-box;
}
Demo
Compatibility:
Firefox 3.6, Safari 5, Chrome 6, Opera 10, IE 9