Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had a similar, quite complex problem with a fluid layout, where the right column had a fixed width and the left one had a flexible width. My fixed container should have the same width as the flexible column. Here is my solution:</p> <p><strong>HTML</strong></p> <pre><code>&lt;div id="wrapper"&gt; &lt;div id="col1"&gt; &lt;div id="fixed-outer"&gt; &lt;div id="fixed-inner"&gt;inner&lt;/div&gt; &lt;/div&gt; COL1&lt;br /&gt;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. &lt;/div&gt; &lt;div id="col2"&gt;COL2&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code> #wrapper { padding-left: 20px; } #col1 { background-color: grey; float: left; margin-right: -200px; /* #col2 width */ width: 100%; } #col2 { background-color: #ddd; float: left; height: 400px; width: 200px; } #fixed-outer { background: yellow; border-right: 2px solid red; height: 30px; margin-left: -420px; /* 2x #col2 width + #wrapper padding-left */ overflow: hidden; padding-right: 200px; /* #col2 width */ position: fixed; width: 100%; } #fixed-inner { background: orange; border-left: 2px solid blue; border-top: 2px solid blue; height: 30px; margin-left: 420px; /* 2x #col2 width + #wrapper padding-left */ position: absolute; width: 100%; } </code></pre> <p><strong>Live Demo</strong>: <a href="http://jsfiddle.net/hWCub/" rel="nofollow">http://jsfiddle.net/hWCub/</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. 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