Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to stick bars to the bottom in this chart
    primarykey
    data
    text
    <p>I made a chart with html+css (i really need it to work in all browsers)</p> <p>its ok but the bars are on the top and i need them to stick to the bottom</p> <p>i tried vertical-align and tried some other things but neither of them worked</p> <p>Here is a jsfiddle (if you see it you'll know what i mean)</p> <p><a href="http://jsfiddle.net/QzHzT/" rel="nofollow">JsFiddle</a></p> <p>Code: </p> <p><em><strong>CSS:</em></strong></p> <pre><code>.clear {clear:both; line-height: 0; width: 0; height: 0} #chart { width: 100%; height: 220px; font-family: Arial,sans-serif; font-size: 12px; line-height: 17px; color: #777777; } #scale, #chartwrap, #description { float: left; margin-right: 7px; } #scale { margin-top: -7px; } #scale i { display: block; text-align: right; } #chartbox { height: 170px; display: inline-block; border: 2px solid #C7C7C7; border-right: 0; border-top: 0; } .thisday { display: inline-block; height: 170px; margin: 0 18px; width: 40px; vertical-align: bottom; } .vbottom { display: block; } .thisday .in, .thisday .out { width: 18px; display: inline-block; vertical-align: bottom; } .thisday .in span, .thisday .out span { text-align: center; font-size: 11px; color: #2F6D91; display: block; } div.inbar, div.outbar { width: 18px; float: left; background: #41799F; } div.outbar { background: #A5D2F0; } div#days { margin-top: 5px; } div#days i { font-size: 11px; float: left; width: 36px; margin: 0 18px; } #description { margin-left: 7px; } #outdes { margin-top: 1px; } #indes i, #outdes i { float: left; display: inline-block; width: 12px; height: 12px; background: #40779D; } #outdes i { background: #A5D2F0; } #indes span, #outdes span { float: left; margin-left: 3px; line-height: 12px; font-size: 11px; } </code></pre> <p><em><strong>HTML:</em></strong></p> <pre><code>&lt;div id="chart"&gt; &lt;div id="scale"&gt; &lt;i&gt;500&lt;/i&gt; &lt;i&gt;450&lt;/i&gt; &lt;i&gt;400&lt;/i&gt; &lt;i&gt;350&lt;/i&gt; &lt;i&gt;300&lt;/i&gt; &lt;i&gt;250&lt;/i&gt; &lt;i&gt;200&lt;/i&gt; &lt;i&gt;150&lt;/i&gt; &lt;i&gt;100&lt;/i&gt; &lt;i&gt;50&lt;/i&gt; &lt;i&gt;0&lt;/i&gt; &lt;/div&gt; &lt;div id="chartwrap"&gt; &lt;div id="chartbox"&gt; &lt;!-- DAILY --&gt; &lt;div class="thisday"&gt; &lt;div class="vbottom"&gt; &lt;div class="in"&gt; &lt;span&gt;50&lt;/span&gt; &lt;div class="inbar" style="height:20px;"&gt;&lt;/div&gt; &lt;/div&gt;&lt;div class="out"&gt; &lt;span&gt;10&lt;/span&gt; &lt;div class="outbar" style="height:5px;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /DAILY --&gt; &lt;!-- DAILY --&gt; &lt;div class="thisday"&gt; &lt;div class="vbottom"&gt; &lt;div class="in"&gt; &lt;span&gt;50&lt;/span&gt; &lt;div class="inbar" style="height:20px;"&gt;&lt;/div&gt; &lt;/div&gt;&lt;div class="out"&gt; &lt;span&gt;10&lt;/span&gt; &lt;div class="outbar" style="height:5px;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /DAILY --&gt; &lt;br class="clear"&gt; &lt;/div&gt; &lt;div id="days"&gt; &lt;i&gt;02-17&lt;/i&gt; &lt;i&gt;02-18&lt;/i&gt; &lt;br class="clear"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="description"&gt; &lt;div id="indes"&gt;&lt;i&gt;&lt;/i&gt;&lt;span&gt;Received&lt;/span&gt;&lt;br class="clear"&gt;&lt;/div&gt; &lt;div id="outdes"&gt;&lt;i&gt;&lt;/i&gt;&lt;span&gt;Sent&lt;/span&gt;&lt;br class="clear"&gt;&lt;/div&gt; &lt;/div&gt; &lt;br class="clear"&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload