html - CSS z-Index with position: relative -
i using css create "gantt-chart" style progress bar.
it consists of empty progress bar, inside green bar represents expected progress. on top of should (thinner) black bar represents actual progress.
the "actual" , "expected" bars independent - i.e. actual more or less expected, can't nest actual bar inside div expected.
i want have number of these little progress bars, in gridview or repeater, can't use position absolute.
how can z-index work actual bar sits "on top" of actual bar?
the css have is:
div.progressbarempty { height:11px; background-color:silver; border: 1px solid black; font-size: 0.1em } div.progressbargreen { position:absolute; top:0;left:0; height:11px; background-color:#00ff33; border-right: 1px solid black; font-size: 0.1em z-index:0; } div.progressbaractual { position:absolute; top:3;left:0; height:5px; background-color:black; border-style: none; font-size: 0.1em z-index:1; }
and html:
<div class="progressbarempty" style="width:100px"> <div class="progressbargreen" style="width:40%" > </div> <div class="progressbaractual" style="width:80%"> </div> </div>
(just clear, "progressbaractual" div should 80% of width of "progressbarempty" div, not "progressbargreen")
edit
here's mockup of i'm after.
the change last demo:
- i changed
top: 3
top: 3px
. - see here why required: (in short, forgot
px
)
absolute positioning not working xhtml?
add position: relative
div.progressbarempty
?
i'm not entirely sure it's supposed like, vaguely gantt chart.
if isn't quite right (as suspect case), it's matter of adding few more properties, let me know what's wrong it.
see:
Comments
Post a Comment