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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:06:13+00:00 2026-06-04T11:06:13+00:00

May I ask whether or not it would be considered ‘bad practise’ to reposition

  • 0

May I ask whether or not it would be considered ‘bad practise’ to reposition a div using javascript based on the height of another absolutely-positioned div which I want it to be behind (z-indexed)?

The main content div is positioned absolutely, and has variable height on each page depending on the ‘dynamically generated’ content. I positioned it absolutely and not relatively because then I ended up with a gap at the bottom of my page where the content div still takes up its original space on the page.

Behind and underneath that content div, with a slight overlap, I want another div. Since the content div is absolutely positioned and of variable height, I can’t relatively or absolutely position my bottom div. So I’m planning to use javascript/jquery to get the height of my content div and position the bottom/behind div relative to it on the page (using absolute positioning).

Is that bad practise, or is that the right thing to do?

Thank you!

Edit: I would assume this is an objective answer, either it is the right way to do things or not…

  • 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-04T11:06:14+00:00Added an answer on June 4, 2026 at 11:06 am

    I would not consider it bad per se, but I would try to prevent having to use JavaScript to do the grand layout of the page. The reason is that layout is something CSS was invented for and most of the time that is enough to get the job done. Sometimes however you just have to use JavaScript because CSS will just not cut it.

    Fot things like this I usually use a css framework that does all this heavy lifting. I absolutely prefer yaml for this.

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

Sidebar

Related Questions

This may not be the kind of question one should ask on StackOverflow, but
This may not be a programming question, but I don't know where to ask
I'm not a DBA so this may be a stupid question but I'll ask
This may not be considered to be directly programming related but I am at
I would like to ask you whether there exists a way to automate reverse-engineering
Let me ask whether using Matlab for my particular problem is nonsense or some
The reason why I ask this is because I need to know whether not
Why you may ask? Because i have built the app on mysql and need
There may be more than one way to ask this question, so here's a
This may be a stupid question to ask, but still I need to know

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.