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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:36:24+00:00 2026-05-11T07:36:24+00:00

I have a relatively -positioned div, which has overflow: auto set. Inside that, I

  • 0

I have a relatively -positioned div, which has overflow: auto set. Inside that, I have a div which acts as a sort of drop-down menu. I want the drop-down div to extend outside of the parent when it needs to, but it is being cropped, since the parent has overflow: auto.

I realize that this is the correct behavior, but I am not sure how to achieve what I want. Here is some example HTML that illustrates the problem:

<div style='position: relative; height: 100px; width: 100px; background: red; overflow: auto;'>        <div style='position: absolute; top: 20px; left: 20px; height: 100px; width: 100px; background: green;'>     </div>  </div>

own div is contextually relevant to the other content in the overflow: auto div, so it makes sense to keep them together. I suppose I could use javascript to move the drop-down div to another part of the DOM, but I’d rather not do that if I can avoid it.

  • 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. 2026-05-11T07:36:25+00:00Added an answer on May 11, 2026 at 7:36 am

    Your problem is the position:relative parent. Since you have that positioning on the element, the inner box will ALWAYS stay within the overflow (position:absolute is relative to the nearest positioned parent).

    To avoid the issue, you can remove the ‘position:relative’ from the outer div, and add a wrapper div with the ‘position:relative;’. You’ll have to then add the ‘top:0;’ declaration to your inner div (you should always have that, actually).

    The end result is one extra div, and it looks like this: (you can remove the ‘z-index:-1’ style, I just added that so you can see the result better)

    <div style='position:relative;border:1px solid blue;'>     <div style='height: 100px; width: 100px; background: red; overflow: auto;'>         if there is some really long content here, it will cause overflow, but the green box will not         <div style='position:absolute; z-index:-1; left: 20px; top:0; height: 200px; width: 200px; background: green;'>         </div>     </div> </div>

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

Sidebar

Ask A Question

Stats

  • Questions 116k
  • Answers 116k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A custom loader that is on autoload is conflicting with… May 11, 2026 at 10:32 pm
  • Editorial Team
    Editorial Team added an answer If the depth can be arbitrary then you cannot solve… May 11, 2026 at 10:32 pm
  • Editorial Team
    Editorial Team added an answer You could use jQuery's animate function to change the opacity… May 11, 2026 at 10:32 pm

Related Questions

I have a relatively simple design that is puzzling me. It has 4 large
I have a major headache trying to get an image that is contained within
I haven't got a unique problem, but for the life of me I can't
I have a container element which I need to resize as its contents change.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.