Note that there are some explanatory texts on larger screens.

plurals
  1. POSection Boxes escaping Div Tag when using 100% Height of viewport for responsive website
    primarykey
    data
    text
    <p>I am currently build the front end to a website using 100% height, so each section of the site takes up the viewport of display. (The site should look similar to others that use this technique such as Square Cash.) </p> <p>The desktop site looks fine, but when making the site responsive the height does not stretch to the content. Making blocks run over the section. This may be because the height is set to 100% so it stops there.</p> <p>The first welcome section is fine, but the second part of the site consists of 4 boxes (section tags) resting inside of a div tag. I am trying to get the boxes to be responsive staying within the container. </p> <p>HTML: </p> <pre><code>&lt;div class="top-section"&gt; &lt;nav&gt; &lt;div class="nav-logo"&gt;&lt;img&gt;&lt;/div&gt; &lt;a href="#registerpage" class="button"&gt;Register&lt;/a&gt; &lt;/nav&gt; &lt;div id="center-column"&gt; &lt;h1&gt;WELCOME&lt;/h1&gt; &lt;/div&gt; &lt;div class="text-banner"&gt; &lt;h6&gt;&lt;/h6&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="bottom-section"&gt; &lt;div id="center-box"&gt; &lt;section&gt; &lt;h6&gt;&lt;/h6&gt;&lt;p&gt;&lt;/p&gt; &lt;/section&gt; &lt;section&gt; &lt;h6&gt;&lt;/h6&gt;&lt;p&gt;&lt;/p&gt; &lt;/section&gt; &lt;section&gt; &lt;h6&gt;&lt;/h6&gt;&lt;p&gt;&lt;/p&gt; &lt;/section&gt; &lt;section&gt; &lt;h6&gt;&lt;/h6&gt;&lt;p&gt;&lt;/p&gt; &lt;/section&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS desktop: </p> <pre><code> html, body{ height:100%; margin: 0; padding: 0; } .top-section{ height:100%; background-color: #3498DB; margin: 0; padding: 0; text-align: center; } #center-column { position: relative; margin: 0; margin-top: 10%; margin-bottom: 5em; padding: 0; } .bottom-section{ height:100%; background-color: #9B59B6; margin: 0;} #center-box { width: 960px; margin-left: auto; margin-right: auto;} section { text-align: center; margin: 2%; float: left; background-color: #8E44AD; height: 300px; width: 400px; } </code></pre> <p>CSS MOBILE: </p> <pre><code> html, body{ height:100%; margin: 0; padding: 0; } .top-section{ height:100%; background-color: #3498DB; margin: 0; padding: 0; text-align: center; } #center-column { position: relative; margin: 0; margin-top: 10%; margin-bottom: 5em; padding: 0; } .bottom-section{ min-height:100%; background-color: #9B59B6; margin: 0;} #center-box { width: 100%; margin-left: auto; margin-right: auto;} section { text-align: center; margin: 0; float: left; background-color: #8E44AD; height: 12em; width: 90%; } </code></pre>
    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. 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