0
I need to make a time line, for that I’m using a progress bar.
But I got a problem, the red scratches, they match the hours, but they don’t add up, as we can see at the last red scratch, it comes out of the bar, and the hours don’t add up either.
In the image we can see that the red risk that divides the 2h and the 3h is not correctly possible.
Does anyone know any way that I can make the time dividers and it checks out?
Each hour is worth 10% ie 1h - 10%; 2- 20% and so on.
<div style="height: 25px;" class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<?=$timeline?>" aria-valuemin="0" aria-valuemax="100" style="width:<?=$timeline?>%"></div>
<div style="width: 10%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 20%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 30%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 40%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 50%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 60%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 70%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 80%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 90%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
<div style="width: 100%; position: absolute; top: 0px; border-right: 2px solid #ff1100;">.</div>
</div>
vlw too much, thank you so much, immensely grateful
– Ricardo
can only explain the functioning of *{position:relative }
– Ricardo
Dude, an element with
position: absolute
needs to be inside an element withposition: relative
so that you can position it within that element, otherwise it will be positioned relative to the first parent element that has therelative
, or if not, tobody
.– Sam
I got it, thank you very much!
– Ricardo