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

287
Views
How can I view droplist on top of other (below) elements (HTML/CSS)

In my WEB application I have created a search-bar which filters products based on users input. Problem is, once I show the suggestions to the user my search results are pushing other elements down. Here is what I mean.

Picture 1. How UI initially looks

enter image description here

Picture 2. How UI looks after user starts typing:

enter image description here

How do I address this so that elements are not pushed down, but dropdown list is shown over these elements (z-index does not work)? Here is my HTML code:

        <div style="width: 80%;" class="search-input">
            <input id='searchBar' type="text" class="form-control w-100" placeholder="Pronadji proizvod ...">
            <div id="autocom-box" class="autocom-box"></div>
        </div>
        <span class="input-group-text cursor-pointer"><i class='bx bx-search'></i></span>

And here is my CSS code:

.search-input .autocom-box {
    padding: 0px;
    max-height:280px;
    overflow-y:auto;
    opacity: 0;
    pointer-events:none;
}
.search-input.active .autocom-box {
    padding: 10px 8px;
    opacity: 1;
    pointer-events:auto;
}
.autocom-box li{
    list-style:none;
    padding: 8px 12px;
    width: 100%;
    cursor: default;
    border-radius: 3px;
    display: none;
}
.search-input.active .autocom-box li{
    display: block;
}
.autocom-box li:hover{
    background: #6b0707;
}

Any help would be much appreciated!

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

0

try adding z-index: 1 to your autocom-box css class

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!