CSS: z-index of next element to change on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to Show

Description

CSS: z-index of next element to change on hover

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ipsum do</title> 
  <style>
ul {<!--from   w ww. j a  v a  2  s  .co  m-->
   display:block;
   list-style-type:none;
   padding:0;
   margin:0;
}

li {
   padding:3px;
   margin:3px;
   position:relative;
   border:2px solid Chartreuse;
   width:49%;
   float:left;
   min-height:21px;
}

li p {
   padding:0;
   margin:0;
   display:block;
   position:absolute;
   top:0;
   left:0;
   display:none;
}

li:hover p {
   display:block;
   background-color:yellow;
   z-index:12;
}

li:hover a {
   z-index:13;
}

li a {
   position:absolute;
   right:3px;
   width:61px;
   display:block;
   background-color:blue;
   z-index:11;
   color:pink;
}
</style> 
 </head> 
 <body translate="no"> 
  <ul class="list"> 
   <li> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra</p> <a href="">Lorem i</a> </li> 
   <li> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra</p> <a href="">Lorem i</a> </li> 
   <li> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra</p> <a href="">Lorem i</a> </li> 
   <li> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra</p> <a href="">Lorem i</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials