Pages

Tooltip with CSS

HTML Code

Hover Me!this is tootip text 

CSS Code

a.tooltip {
 text-transform: uppercase;
  background: #ececec;
  color: #555;
  cursor: help;
  font-family: arial;
  font-size: 20px;
  margin:0;
  padding: 15px 20px;
  position: relative;
  text-align: center;
  width: 200px;
}
a.tooltip .cloud_box {
 background: #1496bb;
  bottom: 100%;
  color: #fff;
  display: block;
  left: -25px;
  margin-bottom: 15px;
  opacity: 0;
  padding: 20px;
  pointer-events: none;
  position: absolute;
  width: 100%;
}
a.tooltip .cloud_box:before {
  bottom: -20px;
  content: " ";
  display: block;
  height: 20px;
  left: 0;
  position: absolute;
  width: 100%;
}  
a.tooltip .cloud_box:after {
  border-left: solid transparent 10px;
  border-right: solid transparent 10px;
  border-top: solid #1496bb 10px;
  bottom: -10px;
  content: " ";
  height: 0;
  left: 50%;
  margin-left: -13px;
  position: absolute;
  width: 0;
}
 a.tooltip:hover .cloud_box{  opacity: 1;
  pointer-events: auto;

Result



Hover Me!this is tootip text

No comments:

Post a Comment