What is the best way to adjust the z-index of a dropdown auto complete to appear above a background image?

Is there a way to adjust the z-index of the drop-down autocomplete box so that it appears above a background image?

Take a look at this screenshot:

https://i.sstatic.net/H90jV.png

The four images below are background images styled with sprite CSS. The area box represents the drop-down autocomplete, with its position set to absolute and z-index set to 100. Despite this, it is still not overlapping the background image.

Here is the CSS code for the drop-down box and the section below it:

Drop Down Box:

.tt-dropdown-menu,
.tt-menu {
  position: absolute;
  top: 79%!important;
  left: 9px!important;
  z-index: 1000;
  min-width: 160px;
  width: 94%;
  padding: 5px 0;
  margin: 2px 0 0;
  list-style: none;
  font-size: 14px;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0px!important;
  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  background-clip: padding-box;
}

Section Below:

.hero-banner {
  color: #555;
  padding-top: 50px;
  padding-bottom: 50px;
  background-color: #EFEDEB;
  border-bottom: 1px solid #D2D2D2;
}

Sprite CSS:

.why_casebox {
  background-image: url(../images/why-casebox/why_casebox.png);
  background-repeat: no-repeat;
  display: block;
  margin: auto;
}

.sprite-verified {
  width: 128px;
  height: 128px;
  background-position: -143px -143px;
}

Even the title and description text seems to be overriding the desired style.

Answer №1

.hero-banner {
    z-index: 0;
}

Alternatively

I am unsure if the position is applied to the entire div or only to the third child with an icon.

.why_casebox {
     z-index: 0;
}

This will ensure that the image is positioned behind the dropdown menu.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the process for adding a Contact Us page to a website?

I recently created a website using html, css and Javascript. I would like to include a 'get in touch' page where visitors can send me messages directly on the site. What steps should I take to make this happen? Is it necessary to set up a databas ...

Tips for resizing images to fit different screen sizes on your website

I have a website with an image that is currently responsive thanks to bootstrap. The width adjusts properly on different devices, but I want the image to crop to the left and right when it's enlarged in this specific case. I've tried various tec ...

Looking to distinguish selected options in a multiple select in AngularJS by making them bold?

When working with Angular, I have a multiple select drop down with options such as Select fruits, Apple, Orange, Banana. How can I make the selected options, like Banana and Apple, appear in bold and change background colors? ...

Determine in Jquery if all the elements in array 2 are being utilized by array 1

Can anyone help me figure out why my array1 has a different length than array2? I've been searching for hours trying to find the mistake in my code. If it's not related to that, could someone kindly point out where I went wrong? function contr ...

Arranging two stretchable div elements side by side

I'm currently working on a web page layout where I want two divs to be flexible and adjust their size as the browser window is resized. However, I've encountered an issue where instead of shrinking, the line breaks between the two divs when the w ...

Padding needed for floated <li> items in horizontal menu

I'm attempting to design a horizontal top header featuring a main navigation stacked above a sub-navigation. Both navigations are constructed using <ul> elements with floated <li> items. The sub-navigation mysteriously has excess horizonta ...

When converting a block formatting context into a block, the margin does not collapse

It seems that the behavior of margins collapsing between block elements inside and outside a BFC is not as straightforward as expected. For instance, when a button element's display property is set to inline-block, it forms a BFC, which should prevent ...

Difficulties encountered when attempting to use a background image for shadow effects within a CSS design

I have been learning from a tutorial on how to create a fixed tabless CSS layout, starting from Photoshop and ending with HTML+CSS code. Here is the final example suggested by the tutorial (how it should look like in the end): And this is my own version ...

Is there a way to enable hover functionality on mobile devices? I wish for the hover effect seen on desktop to be triggered automatically on mobile devices

I attempted to implement @media (hover: hover) without success. In my design, I have three images in a row that reveal a text overlay when hovered over with a mouse. However, the issue arises when I try to switch to a mobile view, as the images remain un ...

Ways to change the background image when hovering in a React component

I'm having trouble trying to scale my background image by 1.5 when the user's mouse enters. Here is the code I have so far: import React from 'react'; import Slider from './index'; import horizontalCss from './css/hori ...

Calculating the median in JavaScript utilizing a for loop

Currently, I am in the process of learning JavaScript. My goal is to calculate the median of a set of numbers that I input through a prompt when I click the button labeled "find median". function CalculateMedia() { var n = prompt("Enter the number of e ...

Utilizing Node.JS Nodemailer for sending emails with extensive HTML code

I am encountering an issue. I am working with Node.JS nodemailer. const url = `${url}`; var mailOptions = { from: 'stackoverflow', to: email, subject: 'test', html: 'Please click this email to confirm your email: &l ...

Using the <br /> HTML tag may face cross-browser compatibility issues

Having some trouble with the HTML <br /> tag. I'm trying to stack 2 images on top of each other. When there is no <br /> between them, the bottom border of the top image touches the top border of the bottom image, which seems correct. Ho ...

Submit the chosen options as an array

I am working with a select list in HTML that looks like this: <input type="checkbox" name="drive_style" value=1 checked />123<br /> <input type="checkbox" name="drive_style" value=2 />123<br /> <input type="checkbox" name="drive ...

Utilizing Jquery for draggable/droppable functionality in combination with custom overflow styles

Encountering a challenge with a drag and drop system that utilizes CSS overflow properties to enable vertical scrolling of a list of values. The issue arises when dragging an item between selected and unselected areas, causing the dragged item to disappear ...

How can I create a dashed border for a pie chart using highcharts?

Is there a way to change the default solid border of a pie highchart to dashed? This modification is only necessary for pies without data or with negative data values. Perhaps it's possible to redraw the SVG of the border, like in this example: https: ...

CSS shrink effect upon hovering

I'm currently working on designing a menu using <ul>/<li> tags along with CSS styles. Here's the progress I've made so far with my menu design: https://jsfiddle.net/gANfS/6/ However, I encountered an issue where if you hover ov ...

Creating a dynamic webpage with flexible design and interconnected containers using the Bootstrap framework

Creating a responsive layout with nested divs using Bootstrap Check out my HTML code below: <div class="container-fluid" style="height: 350px;"> <div class="row-fluid clearfix" style="height: 100%"> <div class="col-md-9 column" ...

Dynamic Motion of HTML Elements

I'm facing a challenge where the elements on my website do not stay in place within their designated sections when I zoom out. Despite my efforts to inspect and adjust the properties of these elements, I can't seem to pinpoint the root cause of t ...

Transmit information through a router connection

When attempting to pass data from one page to another routing page using [queryParams]="{'usd':usd, 'count' :country, 'name' :name}" through the routing button, it works perfectly fine but an error is displayed in my console. ...