Ensure that the background div stretches vertically to 100%, even if the content is overflowing

After scouring through countless posts, I still can't seem to figure out what's missing in my code. Here is the issue I am facing:

http://jsfiddle.net/ttGgH/

The div on my page stretches vertically perfectly upon loading. But as soon as there is more data that requires scrolling, the div no longer expands and stops at 100% of the original window size. Is there something I'm overlooking to make it stretch 100% vertically regardless of the amount of data inside? I apologize if this is a common issue with an existing solution, but I couldn't find anything!

CSS:

html, body {
    height: 100%;
    background:#333;
    margin:0;
}

.container_fullscreen {
    position: absolute;
    width: 80%;
    height: 100%;
    left: 0px;
    right: 0px;
    top: 0px;
    bottom: 0px;
    background:#ccc;
    margin: 0 auto;
}

.BRC_main_wrapper {
    height:100%;
    top: 0px;
    bottom: 0px;
    padding: 0px;
    width:100%;
    margin: 0 auto;
}

.BRC_main_sidenav {
    width:120px;
    height:100%;
    top:0px;
    bottom:0px;
    float:left;
}

.BRC_grid_4columns {
    min-width:275px;
    width:100%;
    max-width:357px;
    float:left;
}

.BRC_grid_activegutter {
    margin:8px;
}

HTML:

<body>
<div class="container_fullscreen">
    <div class="BRC_main_wrapper">
        <div class="BRC_main_sidenav"></div>
        <!--- grid --->
        BLA BLA BLA<br>
        BLA BLA BLA<br>
        BLA BLA BLA<br>
        <!--- end grid --->
    </div>
</div>
</body>

Answer №1

Eliminate all absolute positioning within the container and implement the following:

 overflow:auto 

Also, include this in your body section:

margin: 0;

Check out an example here: http://jsfiddle.net/ttGgH/2/

Answer №2

Take a shot at this

min-height: 100%;

Isn't it funny how my response is brief, yet straight to the point?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The functionality of jQuery date picker and time picker is compromised when the fields are generated dynamically

I am currently utilizing the jQuery code below to dynamically create multiple input fields, which include time pickers and date pickers. However, I am encountering an issue where they are not functioning as expected. $('#add_another_event').clic ...

Having difficulty in closing Sticky Notes with JavaScript

Sticky Notes My fiddle code showcases a functionality where clicking on a comment will make a sticky note appear. However, there seems to be an issue with the Close Button click event not being fired when clicked on the right-hand side of the note. I have ...

Tips for aligning a flex element child vertically

I am trying to achieve a layout where there are 3 divs vertically centered in one flex container with flex-direction:column. However, I need the 3rd div to be positioned at the bottom of the container. To better illustrate what I am looking for, you can v ...

Why isn't the horizontal form displaying its elements in a horizontal orientation?

After running my code, the output looks something like this: <div class="container col-sm-4" style="background-color: wheat"> <form action="/AwfulSite/Search/Index" class="form-horizontal" method="post" role="form"> <div class="form-g ...

Alter the button ID based on the currently displayed div

My mind is being driven crazy by a particular issue I am experiencing. Let me explain... I have a lengthy scrolling page with approximately 10 divs stacked one after the other without any spacing in between. Positioned at the bottom of the viewport is a bu ...

Modify the navbar background color in bootstrap-vuejs

As per the information provided in the documentation, the instructions for setting styles for the navigation bar are as follows: <b-navbar toggleable="lg" type="dark" variant="info"> <!-- Or --> <b-navbar toggleable="lg" type="dark" variant ...

PHP is sending incomplete email messages

After implementing a PHP script to send an email upon unsubscribing, I encountered an issue where only part of the email was being sent. Here is a JSFiddle example that represents how the complete email should look, although it may not appear neat due to b ...

When anchor is set programmatically, the focus outline is not displayed

I am currently facing an issue with my application where I am programmatically setting focus on elements in certain scenarios. While it generally works well, I have noticed that when I set the focus on an anchor element using $("#link1").focus(), the focus ...

"Looking for a solution to the ESLint error related to 'no-unused-var' and Google Maps integration. How can I effectively resolve

I'm struggling with what seems to be a simple problem I tried adding /* export myMap */ or /* global myMap */ at the beginning of the script but I keep getting errors Code HTML <h1>My First Google Map</h1> <div id="googleMap" ...

Is it necessary to download the PDF file for accessibility purposes?

Currently, I am working on a website that includes downloadable PDF links. We are utilizing a parameter at the end of the file download URL to instruct the browser on how to handle the file: https://example.com?ref=0&download=y By using the download= ...

Angular failing to bind data within an image element

I am currently following an Angular series on Lynda.com and facing a roadblock. Although I am new to Angular, the main issue is that I am attempting to iterate through data in order to fetch images from a folder and assign an h1 name to each image. Below i ...

Imagine a complex JSON structure with multiple levels of nesting

Take a look at this JSON data : { department_1 : [{ id : 1, name = Joe Smith, email : <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="660c150b0f120e2613150048030213">[email protected]</a>}, ...., { id : 500, name ...

Displaying Child1 on hover in CSS is simple using the Parent > Child1:hover selector. But how can we display Child2 using

Is there a way to modify my CSS Combo Box to display the menu div when hovering over the button div instead of the dropdown div? I have a container div with a dropdown div containing a button and a hidden menu. Currently, the menu is displayed when hoveri ...

After deploying DRF, the CSS in Django admin is not displaying

After developing a web application using Django Rest Framework and React, I faced an issue during deployment on IIS. While the deployment is successful, I encountered a problem with the Django Admin where the styles were not displaying properly. This led t ...

When the user clicks on the iframe, they will be redirected to the

My goal is to create a scenario where clicking on an iframe opens the same URL in a new browser tab, while ensuring that scroll and other mouse events within the iframe are not affected. I have experimented with various approaches but none have been succe ...

Leveraging perl's CGI.pm within various subroutines

I am currently working on a school project that requires me to write a Perl CGI script to build a social networking site. While I have successfully created multiple subroutines for different pages, I am encountering an issue. When I try to execute each su ...

Prevent elements from collapsing within the Bootstrap 5 grid system

Hey there, happy Friday everyone! I've been working on rebuilding my company's website to learn HTML and CSS. I'm currently creating a replica of the original site and it's going really well so far. However, I've run into some is ...

The rotation of an image in Microsoft Edge results in an HTML file display

One of the images on my website is sourced like this: <p> <img src="images/image.jpg" style="width: 50%;" /> </p> Surprisingly, in Chrome and Firefox, the image looks fine (just how I uploaded it to the server). H ...

Experiencing a hiccup in your jQuery animation?

Click here to access the fiddle demonstrating the issue. A situation arises where a span with display: inline-block houses another span that is being slowly hidden. The container span unexpectedly shifts back to its original position once the hiding proces ...

The issue of the Dropdown Menu Not Remaining Fixed While Scrolling

There is a challenge with a Datetime Picker Dropdown Menu not staying in place when the user scrolls. Previous attempts to use .daterangepicker {position: fixed !important;} have been unsuccessful, causing the Datetime Picker to not stay fixed in its posit ...