Creating a responsive layout in HTML/CSS where the div element expands to fill the entire vertical space of its parent

Looking for assistance in creating a webpage layout like the one shown in this fiddle...

http://jsfiddle.net/jeljeljel/5BSva/

I need the vertical line on the left side navigation tab to extend all the way down to the footer at the bottom of the page.

The footer should always remain at the bottom of the page, even if the content doesn't fill up the entire space. Additionally, if the content exceeds the viewport height, the footer should be pushed further down.

Can anyone help me solve this challenge?

HTML

<div class="wrapper">
    <div class="header">
        HEADER
    </div>
    <div class="body">


        <ul class="nav nav-tabs" id="tabcontrol">
            <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
        </ul>

        <div class="tab-content">
            <div class="tab-pane active" id="home" style="">
                <div class="navigation" style="">
                    navigation<br />
                    navigation<br />
                    navigation<br />
                </div>
                <div class="content">
                    content
                </div>
            </div>
        </div>


    </div>
    <div class="push">
    </div>
</div>
<div class="footer center">
    <div style="border-bottom: 2px solid rgb(174, 174, 201); background-color: #fff;"></div>
    <div>
        FOOTER
    </div>
</div>

CSS

.body {
    border: 1px solid rgb(174, 174, 201);
    border-top: 5px solid rgb(174, 174, 201);
    border-bottom: 5px solid rgb(174, 174, 201);
    border-left: 2px solid rgb(174, 174, 201);
    border-right: 2px solid rgb(174, 174, 201);
    padding-bottom: 1000px;
    margin-bottom: -1000px;
}

/* Sticky Footer by Ryan Fait (http://ryanfait.com/) */
* {
    margin: 0;
}

html, body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -50px auto; /* the bottom margin is the negative value of the footer's height */
    overflow: hidden;
}

.footer {
    height: 50px;
    background-color: #f8f8f8;
}

.footer, .push {
    height: 50px; /* .push must be the same height as .footer */
    clear: both;
}

form {
    height: 100%;
}
/* Sticky Footer by Ryan Fait (http://ryanfait.com/) */

.navigation {
    float: left;
    width: 150px;
    border-right: 3px solid rgb(174, 174, 201);
    padding-top: 10px;
    white-space: nowrap;
}

.content {
    padding-top: 10px;
}

.nav {
    margin-bottom: 0px;
}

Answer №1

Task completed.

To achieve the desired outcome, you simply need to set your column to be positioned absolutely and then make additional adjustments.
Below is the code snippet that needs to be added for this functionality:

.navigation {

    position:absolute;
    bottom:50px;
    top:65px;
        }
.content {
    margin-left:160px;
}

Furthermore, you can view the updated fiddle here (a red footer has been included for visibility enhancement)
I trust this information proves beneficial
Best regards

Answer №2

It seems like you're looking to create a faux column!

Check out this link for more information on that:

I hope this helps you find the answer you're looking for! :)

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

Maintain original image file name when downloading

I have successfully created a download link containing a base 64 encoded image. The only issue is that I need to retain the original file name, which is dynamic and cannot be hardcoded. downloadImage: function(){ var image_url = document.getEleme ...

Error encountered in loop for concatenating html elements: identifier unexpectedly found (jquery + html + php)

I am attempting to concatenate HTML inside a variable within a loop and then return it populated. However, I am encountering an error: Uncaught SyntaxError: Unexpected token += in my code. <a style="cursor: pointer" id="addmore">More Entree ?</ ...

Creating a JavaScript array in Rails 4 based on current data without the need to reload the webpage

Currently in my rails 4 app, I am working on a unique tags validation using jquery validate to ensure that tags are not duplicated before they can be added to an item. The tag list structure is as follows: <div id="taglist"> <span class="label ...

What is the most effective way to combine cells within an HTML table?

I am struggling with merging cells in the first row of a table. I would really appreciate some guidance on how to resolve this issue. Thank you. Here is the code snippet: <!DOCTYPE html> <html> <head> <style> </style> < ...

Customizing the DatePicker with a unique button in material-ui

For my current project, I am utilizing a Datepicker component. I am looking to incorporate a custom information button in the upper right corner of the calendar layout, similar to the example image provided below: https://i.stack.imgur.com/fHMbn.png Unfo ...

Can you identify the language of this HTML include code snippet?

Recently, I came across some .html files that include tags in a different format: [% INCLUDE '/path/to/footer.html' %] This bracket-and-percent-sign tag is unfamiliar to me. Does anyone know what it is used for? ...

Creating a connection between a secondary jQuery anything slider and a distinct CSS style on a webpage

Currently, I am attempting to incorporate two anything sliders within the same webpage. My goal is to apply unique styling to each slider. Despite my efforts, I am encountering difficulties in calling upon a second style sheet without it completely overr ...

What is the best way to have text fit perfectly into a table cell?

In my asp.net table, the first column contains captions for each row of data. The length of these captions varies, with different amounts of words in each one. I am looking to align the first letters of each caption at the beginning edge of the cells (left ...

Tips on how to change an image tag into a CSS selector

I need to change this tag to a WebElemet using CSS Selector instead of Xpath. I attempted with Xpath as shown below: panelSectionTitle.find( By.cssSelector( "img.aw-layout-right[style='']" ) ) <img style="" class="aw-layout-right" height="2 ...

Tips for avoiding cursor sticking in css rotate transform in firefox?

I have a unique challenge in this code where I want the user to grab the black square and rotate it around the inner circle. Check out the code snippet here. While attempting to rotate the square, you might notice that the cursor sometimes gets stuck in ...

Creating a Stroke on an html5 canvas with the help of EaselJS

As a newcomer to Easel and HTML5, I am attempting to draw a line on a canvas using EaselJS. The X-coordinate is set to 100 while the Y-coordinate is taken from an array list. Below is the code I have written. Can someone please help me identify where my ...

Building Effective Web Designs with Bootstrap and Semantic Grid System

There are several ways to effectively organize and maintain the Bootstrap Grid. For example: <div id='header'> <div class='row'> <div class='col-md-6 header-left'> or <div id='header&ap ...

Ways to create an oval background for my button

Can someone help me create a button with a unique shape similar to the Products button on stack overflow? Check out this image for reference I attempted using border radius, but it didn't give me the desired effect. I searched for other options but c ...

another option besides the nextElementSibling

I have a unique code that applies a style to the following div when another div is clicked, using nextElementSibling. var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) { acc[i].addEventListener("clic ...

Tips to prevent browser from freezing while creating a large number of HTML elements

I am currently utilizing Selection.js to develop a customizable grid on my website. To make this work effectively, I need a specific number of div elements to establish the selectable area. In my scenario, I generate all the divs using a for loop and then ...

Utilizing URL parameters to send data to a Python CGI script

My goal is to pass parameters into my cgi script in order to display a specific post when a URL like www.helloworld.com/cgi-bin/world.py?post=101 is entered. I've attempted the following: link = '<a href="world.py?post=%s">test</a>& ...

Is there a way to delete the header box in IPBoard?

Recently, one of our team members working on the website decided to go rogue and sneak in a large box featuring a Dremel ad. Unfortunately, I am clueless when it comes to removing it. The website is self-hosted with full admin access. ...

The background color spills outside the column when using 100% width

Bootstrap 5 is being used, and two columns have been created on the page. The current output looks like this: https://i.stack.imgur.com/P6oZs.png Now, there's a need to display an orange color from end to end of the left column. To achieve this, h- ...

Saving functions in the localStorage API of HTML5: A step-by-step guide

I have encountered an issue while trying to store an array in local storage using JSON.stringify. The array contains functions (referred to as promises) within an object, but it seems that when I convert the array to a string, the functions are removed. Su ...

The image width does not match the width of the table element

Currently, I am working on an HTML newsletter and facing an issue where the width of my image does not match the full width of the td tag, despite both having the same pixel value. The image appears as 180 pixels wide, whereas the td tag is set to be 186 ...