Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
The DropDown Menu get cut off when parent have overflow

I created a DropDown menu, I used my real project source code for it so that there should be no confusion:-

.main-container {
  overflow-x: auto;
}

div.btn-dropdown-options {
    font-family: "Haas Grot Text R Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    
    position: absolute;
    z-index: 1000;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    margin-top: 4px;
    overflow: auto;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    background: #fff;
    visibility: hidden;
  opacity: 0;
  transition: opacity 2s, visibility 2s;
    
    
    -webkit-box-shadow: 0px 1px 2px rgba(128,138,157,0.12),0px 8px 32px rgba(128,138,157,0.24);
    box-shadow: 0px 1px 2px rgba(128,138,157,0.12),0px 8px 32px rgba(128,138,157,0.24);
}

I have a dropdown menu div.btn-dropdown-options and a parent container main-container. When I click on the toggle button to show the dropdown it gets cut off due to overflow property, I have used position: absolute and z-index: 1000;, but nothing is working, how can I show the dropdown menu above the overflow?

full-code :- https://jsfiddle.net/ur5sL4qv/

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

  1. it will be resolved by assigning height to main-container

.main-container {overflow-x: auto; height: 100vh;}

or

  1. Use position relative instead of absolute in div.btn-dropdown-options

div.btn-dropdown-options {position: relative;}

about 4 years ago · Juan Pablo Isaza Report

0

Not sure I fully understand the problem (I suggest using background colors for signaling what's undesireable). But does removing overflow-x from .main-container and adding position: absolute to dropdown options fixes your issue?

.btn-dropdown .btn-dropdown-options {
    position: absolute;
    right: 0;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!