Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is one way of doing it by using CSS display types of <code>table</code> and <code>table-cell</code>.</p> <p>You need to make a small modification to your left and right child elements, simply define a wrapper <code>.content</code> div to enclose any content.</p> <p>The <strong>HTML</strong>:</p> <pre><code>&lt;div class="second_bar"&gt; &lt;div class="status_border left"&gt; &lt;div class="content"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="nav_bar"&gt;&lt;/div&gt; &lt;div class="status_border right"&gt; &lt;div class="content"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>and the <strong>CSS</strong>: </p> <pre><code>.second_bar { height:80px; width:100%; border: 1px dotted blue; display: table; } .status_border { display: table-cell; vertical-align: top; width: auto; background-color: yellow; } .status_border .content { width: auto; height: 14px; background-color: pink; } .nav_bar { display: table-cell; vertical-align: top; height: 80px; width: 980px; min-width: 980px; background-color: green; } </code></pre> <p>For your container block <code>.second_bar</code>, set the display type to <code>table</code> and the width to 100%.</p> <p>The child elements <code>.status_border</code> and <code>.nav_bar</code> have <code>display: table-cell</code> and <code>vertical-align: top</code>, but you may adjust that depending on your layout requirements.</p> <p>The <code>.nav_bar</code> child div has a width of 980px, but because it is a table cell, the width could shrink to less than 980px if the window is small enough. Table cell's will shrink to fit the content if needed. To maintain the full width, set the <code>min-width</code> to the width.</p> <p>To get your left and right status indicator bars to be 14px high, you need to have a separate block element with the left and right child elements.</p> <p>By default, the three <code>table-cell</code> blocks will take the height of the tallest of the three table cells, in this case, the 80px <code>.nav_bar</code> div.</p> <p>If you set <code>.content</code>'s width to auto, it will both will take on the same width and fill up the rest of the available page width.</p> <p>Note that <code>table-cell</code> is not supported in IE8, but otherwise, this is a pretty useful pattern.</p> <p>See demo fiddle at: <a href="http://jsfiddle.net/audetwebdesign/SyAAQ/" rel="nofollow">http://jsfiddle.net/audetwebdesign/SyAAQ/</a></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.
    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