Hover on anchor to stay put with absolute positioning - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Hover on anchor to stay put with absolute positioning

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
a {<!--  ww  w  .java 2s  .c  o m-->
   text-decoration:none;
}

#container {
   position:relative;
   width:1101px;
   height:681px;
   margin:0px auto;
   font-family:verdana, arial, sans-serif;
   font-size:13px;
   z-index:2;
   border:2px solid;
}

#container a.pics {
   position:absolute;
}

#container a.pics img.thumb {
   display:block;
   border:2px solid Chartreuse;
}

#container a.pics span {
   display:none;
   border:0;
   border:hidden;
   text-align:center;
}

#container a.pics span img {
   margin:11px auto;
   border:2;
}

#container a.pics:hover {
   white-space:normal;
}

#container a.pics:hover img.thumb {
   border:2px solid yellow;
}

#container a.pics:hover span {
   display:block;
   position:absolute;
   left:106px;
   top:0px;
   z-index:6;
}

img#top {
   position:fixed;
   top:0;
   left:100px;
   border:hidden;
   z-index:-2;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <ul> 
    <li> <a class="pics" href="#">Lorem<span> <img id="top" src="https://www.java2s.com/style/demo/Google-Chrome.png" width="30" height="30"> </span> </a> </li> 
    <li> <a class="pics" href="#">Lorem<span> <img id="top" src="https://www.java2s.com/style/demo/InternetExplorer.png" width="30" height="30"> </span> </a> </li> 
    <li> <a class="pics" href="#">Lorem i<span> <img id="top" src="https://www.java2s.com/style/demo/Opera.png" width="30" height="30"> </span> </a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials