Why is the menu drop down hiding behind the jQuery button?

div.menu ul li a, div.menu ul li a:visited
{
background-color: #465c71;
border: 1px #4e667d solid;
color: #dde4ec;
display: block;
line-height: 1.35em;
padding: 4px 20px;
text-decoration: none;
white-space: nowrap;
position: relative;
z-index: 9999;
}
I faced this problem too. I found the cause and solution.
Cause: the button is rendered after the menu but it has been wrapped by some additional elements by
jquery-ui, hence itsz-indexhas been increased.Solution: to overcome the problem, we can increase
z-indexof the menu (better way than decreasingz-indexof many buttons). But please remember thatThat so we need to position our menu also. Here is my code: