HTML-Tooltip position relative to mouse pointer - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

HTML-Tooltip position relative to mouse pointer

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ipsum dol</title> 
  <style>
ul#list_of_thrones {
   list-style-type:none;
}

ul#list_of_thrones li {
   position:relative;
   font-size:21px;
   font-family:helvetica, arial, sans-serif;
}

ul#list_of_thrones li>span {
   position:relative;
   display:none;
}

ul#list_of_thrones li:hover>span {
   position:absolute;
   top:0;
   left:100px;
   display:block;
   background:red;
   color:Chartreuse;
   padding:7px;
}

ul#list_of_thrones li:hover>span:after {
   right:100%;
   top:51%;
   border:solid transparent;
   content:" ";<!--from ww  w . j a  v a 2s .c o m-->
   height:0;
   width:0;
   position:absolute;
   pointer-events:none;
   border-color:yellow;
   border-right-color:blue;
   border-width:7px;
   margin-top:-7px;
}
</style> 
 </head> 
 <body translate="no"> 
  <ul id="list_of_thrones"> 
   <li>Lorem ip<span>Lorem ips</span> </li> 
   <li>Lorem i<span>Lorem </span> </li> 
   <li>Lorem ip<span>Lorem i</span> </li> 
   <li>Lorem ips<span>Lorem</span> </li> 
   <li>Lorem ipsu<span>Lorem ips</span> </li> 
   <li>Lorem ip<span>Lorem i</span> </li> 
  </ul>  
 </body>
</html>

Related Tutorials