0

I am creating table

#myUL li a {
  background-color: #f6f6f6;
  padding: 5px;
  width: 100%;
  text-decoration: none;
  font-size: 14px;
  color: black;
  display: block;
}

#myUL li a.header {
  background-color: #e2e2e2;
  cursor: default;
}

#myUL li a:hover:not(.header) {
  background-color: #eee;
}
<input type="text" id="myInput" list="myUL" onclick="openingList()" onkeyup="openingList()" style="width:90%; ">
<ul id="myUL" hidden=true>
  <li>
    <a href="#"></a>
  </li>
</ul>

On click of input tag is myUL is opening. Now I implemented this on the top of some box. Now the problem is when I am clicking, myUL is not displaying fully because it is getting hide because of box. How Can show this always on top.

Note :

  • Applying z-index is also not working.
  • Typing in input is also not working.

Can anybody help me to fix this.

Sreetam Das
  • 3,226
  • 2
  • 22
  • 36
David
  • 4,266
  • 8
  • 34
  • 69

2 Answers2

1

You should use z-index,however, it works with (position:absolute, position:relative, or position:fixed)
So You have to add Position attribute to your #myUL li a style

M. Ewees
  • 41
  • 3
0

add

#myUL li a {
    position: absolute;
}
Jeremy Danner
  • 65
  • 1
  • 7