css - Vertical align of div -


I am trying to create a simple html / css graph, in which to separate the bars for more than 0 values And there are smaller prices than 0. It looks like this: And I'm stuck with the vertical alignment of the top division focusing from the bottom so I need the div with the class bar class, class graph_top Can someone help me in that? I looked at some tutorials but I could not find anything that worked with percentages in terms of width for width.

Image explanation:

Here is the code:

HTML

  & lt; Div class = "graph" & gt; & Lt; Div class = "graph_top" & gt; & Lt; div class = "lol" & gt; & Lt; div class = "bar" style = "height: 1px;" & Gt; & Lt; / Div & gt; & Lt; Div class = "bar" style = "height: 11px;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "horizontal_line" & gt; & Lt; / Div & gt; & Lt; div class = "graph_bottom" & gt; & Lt; div square = "bar 2" style = "height: 1px;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar 2" style = "height: 11px;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

CSS

  .graph {width: 95%; Height: 101px; Border: 1 Px Solid # EEEEE; Background color: #EEAAA; } .graph_top {width: 100%; Height: 50px; Max-height: 50px; Status: Relative; } .graph_bottom {width: 100%; Height: 50px; Max-height: 50px; } .horizontal_line {width: 100%; Border Bottom: 1 Px Solid # EEEEE; Height: 1px; Padding: 0 pixels; } .bar {width: 10%; Background color: # AIEEE; Swim left; } .bar2 {width: 10%; Background color: Maroon; Swim left; } .lol {width: 100%; Status: Completed; Bottom: 0; }   

Thanks for the answer.

You just change the left position with 10% for each bar We do.

  .graph_top {width: 100%; Height: 50px; Max-height: 50px; Status: Relative; } .bar {status: absolute; Bottom: 0; Width: 10%; Background color: # AIEEE; } & Lt; Div class = "graph" & gt; & Lt; Div class = "graph_top" & gt; & Lt; div class = "bar" style = "height: 1px; left: 0;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar" style = "height: 11px; left: 10%;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar" style = "height: 30px; left: 20%;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar" style = "height: 25px; left: 30%;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar" style = "height: 15px; left: 40%;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar" style = "height: 6px; left: 50%;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "horizontal_line" & gt; & Lt; / Div & gt; & Lt; div class = "graph_bottom" & gt; & Lt; div square = "bar 2" style = "height: 1px;" & Gt; & Lt; / Div & gt; & Lt; div class = "bar 2" style = "height: 11px;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -