Get content from data-title attribute for CSS - HTML CSS CSS

HTML CSS examples for CSS:Function

Description

Get content from data-title attribute for CSS

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">
.tooltip {<!-- w  ww  . jav  a2  s.c o m-->
   display:inline;
   position:relative;
}

.tooltip:hover:after {
   background:Chartreuse;
   background:yellow;
   border-radius:6px;
   top:27px;
   color:blue;
   content:attr(data-title);
   left:21%;
   padding:6px 16px;
   position:absolute;
   z-index:99;
   width:221px;
}

.tooltip:hover:before {
   border:solid;
   border-color:pink;
   border-width:0 7px 7px 7px;
   top:21px;
   content:"";
   left:51%;
   position:absolute;
   z-index:100;
}
</style> 
 </head> 
 <body> 
  <br> 
  <br> 
  <br> 
  <br> 
  <a href="#" data-title="This is some information for our tooltip." class="tooltip"> <span>CSS3 Tooltip</span> </a>  
 </body>
</html>

Related Tutorials