We would like to know how to add span tooltip to anchor.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.tooltip {<!--from w w w . j a va 2 s.co m-->
border-bottom: 1px dotted #000000;
color: #000000;
outline: none;
cursor: help;
text-decoration: none;
position: relative;
}
.tooltip:hover span {
font-family: Calibri, Tahoma, Geneva, sans-serif;
position: absolute;
left: 1em;
top: 2em;
z-index: 99;
margin-left: 0;
width: 250px;
display: block;
}
span {
display: none;
}
</style>
</head>
<body>
<a class="tooltip" href="#">Click <span>This is a tooltip</span></a>
</body>
</html>
The code above is rendered as follows: