Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are two ways that work, both with caveats (warning, both require a wrapper):</p> <h3>HTML</h3> <pre><code>&lt;section class="wrapper"&gt; &lt;div class="column" id="a"&gt;&lt;/div&gt; &lt;div class="column" id="b"&gt;&lt;/div&gt; &lt;div class="column" id="c"&gt;&lt;/div&gt; &lt;/section&gt;​​​​​​​​​​​ </code></pre> <h3>Base CSS</h3> <pre><code>.column { height: 3em; } #a { background-color: red; } #b { background-color: green; } #c { background-color: blue; } #b { width: 50px; } </code></pre> <h3>CSS3 Approach:</h3> <pre><code>.wrapper { display:box; box-orient:horizontal; box-align:stretch; } #a, #b { box-flex:1.0; } </code></pre> <p>Caveat: Only supported (so far) in Firefox and Webkit (Chrome/Safari), both requiring prefixed rules. The above is what it will be someday. </p> <p>Here is a demo with prefixes: <a href="http://jsfiddle.net/crazytonyi/cBVTE/">http://jsfiddle.net/crazytonyi/cBVTE/</a></p> <h3>Table-Display approach</h3> <pre><code>.wrapper { display: table; width: 100%; table-layout: fixed; } .column { display: table-cell; } </code></pre> <p>Caveats: IE didn't start supporting this display type until 7 or 8. On the other hand, worrying about users on older versions of IE is like worrying about people who still turn off cookies and javascript. Either they catch up or get used to pages breaking. End the pandering!</p> <p>Here's a demo using the above: <a href="http://jsfiddle.net/crazytonyi/kM46h/">http://jsfiddle.net/crazytonyi/kM46h/</a></p> <p>In both cases, no floats or positioning needed, just willingness to give the middle finger to older browsers. How old depends on which method you choose.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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