Ronak
Ronak

Reputation: 11

how can i override z-index of drop-down auto complete over background image?

How can I set z-index of the drop-down autocomplete box over a background image?

Here is a screenshot:

enter image description here

Below four images are background images with sprite CSS and the area box is drop-down autocomplete and it has position set to absolute and z-index set to 100, but still it's not overlapping background image.

Here is the CSS for the drop-down box and the bottom section.

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;
}

Below Section:

.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 though the title and description text are also overriding.

Upvotes: 0

Views: 436

Answers (1)

Anand Jackie
Anand Jackie

Reputation: 56

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

or

I don't know whether it is position above for whole div or for the third child with icon.

.why_casebox {
     z-index: 0;
}

so that image will position behind the dropdown.

Upvotes: 1

Related Questions