Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can make it like this:</p> <p>Say you have those 2 divs inside a parent container, which expands to fit the page:</p> <pre><code>&lt;div id="container"&gt; &lt;div id="autowidth"&gt;text expands her...&lt;/div&gt; &lt;div id="fixed"&gt;This is a fixed column&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>In your CSS:</strong></p> <pre><code>#container { width:100%; border:1px solid black; padding-right:200px; } #autowidth{ width:100%; background-color:red; float:left; } #fixed{ width:200px; background-color:green; float:right; margin-right:-200px; } </code></pre> <p>Basically, the parent container holds everything together. It has a padding of 200px (the width of the right col), so that its content doesnt goes beyond that point. In turn, the right col has a margin of -200px, so that it forces the boundaries imposed by the parent padding and places itself always at the foremost right. The other div, actually, now has only the spaces provided by the parent container, constrained by its padding, so its 100% would be, in fact, (100% - (parent's padding)). You can see a working result of this here: <a href="http://jsfiddle.net/bfTDG/" rel="nofollow noreferrer">jsfiddle.</a></p> <p>I'm pretty sure there might be more elegant solutions out there, so bear with me.</p> <p>if you want to give a background, like it were 2 cols, you can go for the classical 'faux columns' background (see example at <a href="http://www.alistapart.com/articles/fauxcolumns/" rel="nofollow noreferrer">a list apart</a> )</p>
    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. 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