Note that there are some explanatory texts on larger screens.

plurals
  1. POauto resizing a div and all parent divs
    primarykey
    data
    text
    <p>A layout has the following arrangement: (using MVC3 - The whole html is in the <code>Layout.cshtml</code>)</p> <ul> <li>A Top header (containing a Banner and Menu bar) </li> <li>Contents (Divided in Left and Right panes).</li> <li>Footer</li> </ul> <p>The contents of the Right pane contain tabs, and the height can vary depending on the opened tab. </p> <p>I want to make the Contents div auto adjust to the height and not create a scrollbar (Not browser scroll bar).</p> <p>This is somewhat achieved but it breaks the rest of the <code>CSS</code>.</p> <p>Here is the CSS :</p> <pre><code>html { width: 100%; height: 100%; } body { width: 100%; /* height: 100%; */ } #Wrapper { border: 1px solid #6A89C1; height: 100%; margin: 0px auto; min-height: 750px; min-width: 700px; width: 100%; font-size: 0.75em; } header { background-color: #abcdef; height: 19%; /* did not keep it 20% due to some Background repeat issues.. */ margin: 0px; border-bottom: 2px outset #FFFFFF; width: 100%; -webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; } #Banner { height: 72%; width: 100%; padding-top: 5px; } #Menu { height: 25%; width: 100%; } #Contents { height: auto; /*65%;*/ width: 100%; clear: both; } #Contents #LeftPane { background-color: #E9F1FF; border-right: 1px solid #B9D4FF; height: 100%; min-height: 300px; width: 24.8%; /* Should not be exactly 25% as it causes RightPane div to shift downwards */ } #Contents #RightPane { background-color: #FFFFFF; height: 100%; width: 75%; overflow: auto; } .Left { float: left; } .Clear { clear: both; } footer { background-color: #6A89C1; clear: both; height: 15%; width: 100%; margin: 0px; min-height: 50px; } #Wrapper, footer { -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -moz-border-radius-bottomleft: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; } </code></pre> <p><img src="https://i.stack.imgur.com/dRq0s.png" alt="Layout screenshot"></p> <p>The whole center part needs to grow automatically but the Layout (propotions) should be same </p> <p>Attached also is the image after adjusting to the given <code>CSS</code></p> <p><img src="https://i.stack.imgur.com/Wk9Mx.png" alt="layout after adjustment "></p> <p><strong>(notice the menu bar Bg and left pane &amp; footer heights )</strong></p> <p>Hope to have explained the question adequately :)</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.
 

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