Here's a JSFiddle:
Here's a screenshot of what I'm aiming for:
And what I'm getting in my browser:
The key difference is that in the actual implementation, the bars do not fill the available width of the containing div element. If I place: width:100%
, the bar expands to it's container width, but goes down, below the text; despite both elements being floated left.
Any suggestions?
This solution should help: https://stackoverflow.com/a/1767270/1472586
Basically remove float: left
and width
from the bars and add overflow: hidden
to them. You may also have to adjust your margins accordingly (right padding on the headings might work better, for example).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.