Reputation: 362
I want to set list z-index
.
when mouse over list show.
and this list show above <p>
text
here is simple html and css
<style>
ul li{
display:none;
}
ul:hover li{
display:block;
z-index:-1;
}
</style>
<ul><h3>This is LIST</h3>
<li>back</li>
<li>forword</li>
<li>click</li>
</ul>
<p>list show above this text.</p>
with this CSS when mouse over the this is list then its wrapped.
but I want when mouse over at This is LIST
then show there list over the <p>
text.
here is jsfiddle
how its possible.
Upvotes: 2
Views: 130
Reputation: 66388
Sounds like what you want is to "preserve" the place for list items even when they are hidden.
For this purpose, use visibility
CSS attribute instead of display
:
ul li {
visibility: hidden;
}
ul:hover li {
visibility: visible;
}
Upvotes: 0
Reputation: 34556
Z-index applies only to elements that have position 'relative', 'fixed' or 'absolute', not 'static' (which is the default).
Upvotes: 3