开发者

Vertical CSS Progress Bar

开发者 https://www.devze.com 2023-04-11 11:55 出处:网络
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

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>&nbsp;</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, set position: relative.
  • On #progress-level, remove margin-top: 133px and add bottom: 0. Then, change the height to a higher number, say 50%, so that you can see it working.

Vertical CSS Progress Bar


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 ;-) .

0

精彩评论

暂无评论...
验证码 换一张
取 消