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 9023137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:41:23+00:00 2026-06-16T05:41:23+00:00

I am stuck trying to precisely layout an element in my page. I hope

  • 0

I am stuck trying to precisely layout an element in my page. I hope someone can help me out.

Please review http://jsfiddle.net/malaikuangren/5ssqP/2/show/.

Thanks.

My Confused Question List:

  • I don’t know why there is a space above the dev-footer although I have precisely calculated the height of elements (you can see what I have done in the document ready event)
  • This problem is also with the table contents of the right of page
  • Please try to duplicate more rows to see what happens

Thanks.

  • 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-06-16T05:41:24+00:00Added an answer on June 16, 2026 at 5:41 am

    Do not use Javascript to resize these elements. Prefer to use CSS directly. This will allow you to write cleaner code which is easier to edit and performs better. In the particular case, you don’t need to manually calculate the height using Javascript. Instead, utilize CSS positioning to achieve your desired results.

    Specifically, set your main content div to take up all the page in height, excluding the footer and header as follows:

    #content {
        position: fixed;
        bottom: 40px;
        top: 100px;
    }
    

    Then adjust the contents of that div to take up as much space as you’d like them to on-the-fly. For example, you want your sidebar-holder to take up the whole height of the #content div. Therefore, the following CSS code suffices:

    #sidebar-holder {
        position: absolute;
        top: 0;
        bottom: 0;
    }
    

    Similarly, your “splitter” div can be positioned using CSS positioning, but it’s better implemented using a CSS border:

    #sidebar-holder {
        border-right: 5px solid black;
    }
    

    To avoid extensive and unmanageable absolute positioning, use the directive position: relative in your parent elements and position:absolute within your child elements. This technique allows you to position child elements in absolute coordinates within a box defined by their closest relative parent. Therefore, the coordinates (0, 0) correspond to the top-left corner of the parent box.

    I’ve reproduced in your code the full behavior that you desire using CSS only and it fixes your problems directly, without messy pixel value calculations. In addition, replacing Javascript with CSS makes it behave correctly when resizing the page and does not require rerunning your jQuery code on resize events.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am stuck trying to perform this task and while trying I can't help
I've been stuck trying to figure out why a counter cache on my (parent)
I'm stuck trying to get a WinInet HTTP POST via SSL using ONLY C.
I'm really stuck trying to find out how to force a programmatic refresh of
Im stuck trying to figure out how to pull the information from my pre-populated
I'm stuck trying to define an XSD containing a field that can have only
I am stuck trying to figure out how to alter my collision detection to
I'm stuck trying to create a result page that lists details based on a
I've been stuck trying to puzzle this out for a couple days now, and
I am stuck trying to figure out how to declare lists of lists (of

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.