Note that there are some explanatory texts on larger screens.

plurals
  1. PO2 columns of equal height - Twitter's Bootstrap 2.0
    primarykey
    data
    text
    <p>Well, everybody knows that Twitter's Bootstrap is a great tool and makes a lot of things easier for those who, like me, doesn't know much about CSS yet. But, sometimes, it can be a problem too.</p> <p>The thing is: I'm using a fixed 940px-wide, 12-column grid centered layout with two columns, and I wanted that both of the columns had the same height. The code right now is like this:</p> <pre><code>&lt;div class="container"&gt; &lt;div class="content"&gt; &lt;div class="row"&gt; &lt;div class="span8 div-content"&gt; &lt;div class="center95"&gt; &lt;div id="notWrap"&gt; &lt;div id="not"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="span4 div-sidebar"&gt; &lt;div class="center90"&gt; &lt;div id="myPWrap"&gt; &lt;div id="myP"&gt; &lt;/div&gt; &lt;/div&gt; &lt;hr /&gt; &lt;div id="otherPWrap"&gt; &lt;div id="otherP"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;footer id="bottom" class="footer"&gt; &lt;p&gt;&amp;copy;&lt;/p&gt; &lt;/footer&gt; &lt;/div&gt; </code></pre> <p>As you can see, there are divs with no content, like "myP", "otherP" and "not". They are filled through Javascript, and the amount of content stored in them may vary and, because of that, in many times a column (The "columns" here are represented by the div with the "div-content" class and by the div with the "div-sidebar" class) will be bigger than the other (In my particular case, both columns may be "the bigger one").</p> <p>Here's a picture, if it helps: <img src="https://i.imgur.com/am7QV.png" alt="project-pic"></p> <p>Basically, the left column (The <code>&lt;div class="span8 div-content"&gt;</code> in the code) needs to be the same size of the right column (The <code>&lt;div class="span4 div-sidebar"&gt;</code> in the code), and vice versa. Also, if it helps, the yellow part is the <code>&lt;div class="content"&gt;</code> and the white background is the <code>&lt;div class="container"&gt;</code>. The <code>&lt;div class="row"&gt;</code> is just a container of the two columns and has no color.</p> <p>I know that the "columns with same height" problem is a recurrent problem for web programmers, but the solutions I tried so far didn't worked. I really wouldn't like the "Faux Column solution" because, as I am a newbie in CSS, I didn't want to appeal to a workaround like this one. If possible, I'd rather stick to pure CSS.</p> <p>In advance, thanks for those who'll be willing to help.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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