Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6791579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:51:49+00:00 2026-05-26T17:51:49+00:00

I am trying to setup a liquid layout for a page and I am

  • 0

I am trying to setup a liquid layout for a page and I am having great difficulty adjusting the height of the divs. I don’t want a fixed layout because I want the page to fit like a glove, no matter the size of the screen. I am using only percentages, no pixels or em. The layout of the page looks something like this:

header
wrapper
  left column, top
  left column bottom
  right column, top
  right column, bottom
footer

Now, I want to make left column, top 50% height of the page and left column, right the other 50% height of the page. The problem is the content overflows and gets cutoff, forcing me to use scrollbars and set pixel height. This is not what I want. Ideally, I’d like to set the divs to 50% of the page AND use scrollbars if the content overflows. Does that make sense?

How do I go about this? I would really appreciate any help.

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:51:49+00:00Added an answer on May 26, 2026 at 5:51 pm

    This would be something better suited for jquery. You can call it to resize the height on load and on window resize.

    To get the window height and width you would use

    windowHeight = $(window).height();
    windowWidth = $(window).width();
    

    You take this and assign it to a variable and subtract the heights of the header and footer. And in set the css by using

    ${'#content_container').css({width: windowwidth+"px", height: windowHeight+"px"});
    

    Then if someone resizes the window you run the same options in a function like the following

    $(window).resize(function() {
     //update stuff
    });
    

    Your code would look something like below but change would do the same thing for each one.

    $(document).ready(function(){
     windowHeight = $(window).height();
     windowWidth = $(window).width();
     divHeight = (windowHeight - 100 - 100)/2; // heights of your header/footer
     divWidth = windowWidth / 2;
     $('#content_container').css({width: divWidth+"px", height: divHeight+"px"});
    });
    
    $(window).resize(function() {
     windowHeight = $(window).height();
     windowWidth = $(window).width();
     divHeight = (windowHeight - 100 - 100)/2; // heights of your header/footer
     divWidth = windowWidth / 2;
     $('#content_container').css({width: divWidth+"px", height: divHeight+"px"});
    });
    

    you can replace the 100’s for static calls of height by assigning variable and call $(‘#divid’).height(); Since your header is position:absolute, if you subtract the header then you will need to position the div from the top the same px.

    To call js include the following before the javascript above.

    <script src="http://code.jquery.com/jquery-1.6.4.min.js" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to setup my Eclipse for Hadoop using this page I am
iam trying to setup an little search-engine for my website. I want to add
Trying to setup a test page that access a video hosted on S3 and
Been trying to setup my Facebook app which I want to use for Logins
I'm trying setup a subset of boost and get it properly compiled using bjam,
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
After trying to setup my site for Google Webmaster Tools I found that my
I'm trying to setup CruiseControl.net at the moment. So far it works nice, but
I'm trying to setup an Apache/PHP/Postgresql server locally on my machine. I'm using Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.