I am working on creating a progress meter that comes from the bottom up usi开发者_如何学Pythonng only HTML and CSS. The problem I am facing is that the overlayed image doesn't line up where it belongs. Could someone please help me out?
Edit
Here is the code:
<h2>Fall Fest Candy Collection</h2>
<p>The Fall Fest candy collection has begun! Follow along with the progress bar as we attempt to reach our goal of one million pieces of candy!</p>
<p> </p>
<div id="progress-bar">
<div id="progress-level" style="height: 79%; bottom: 0px; text-align: center;"></div>
</div>
<p style="margin-bottom: 15px; text-align: center;">79% collected</p>
<p> </p>
- On
#progress-bar
, setposition: relative
. - On
#progress-level
, removemargin-top: 133px
and addbottom: 0
. Then, change theheight
to a higher number, say50%
, so that you can see it working.
I fixed with:
<div id="progress-level" style="height: 7%; margin-top: 76px; text-align: center;"></div>
Changed the top margin to 76px. That was in Chrome's developer tools.
I would try using position:relative and bottom properties to move the #progress-level up, but I can't try it out now, I am on a mobile device ;-) .
精彩评论