Tooltip Just With CSS

CSS Tooltip

CSS Tooltip

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
span.tool {
position: relative; /* this is key */
cursor: help;
}
span.tool span.tip {
display: none; /* so is this */
}
span.tool:hover span.tip {
display: block;
z-index: 100;
position: absolute;
top: 1.6em;
left: 0;
width: auto;
padding: 3px 7px 4px 6px;
border: 1px solid #336;
background-color: #f7f7ee;
font: normal 0.9em/1.2em arial, helvetica, sans-serif;
text-align: left;
color: #000;
}
#content span.tool::after {
padding-left: 2px; /* eye candy */
content: url(/img/bubble.gif);
}
span.tool { position: relative; /* this is key */ cursor: help; } span.tool span.tip { display: none; /* so is this */ } span.tool:hover span.tip { display: block; z-index: 100; position: absolute; top: 1.6em; left: 0; width: auto; padding: 3px 7px 4px 6px; border: 1px solid #336; background-color: #f7f7ee; font: normal 0.9em/1.2em arial, helvetica, sans-serif; text-align: left; color: #000; } #content span.tool::after { padding-left: 2px; /* eye candy */ content: url(/img/bubble.gif); }
span.tool {
  position: relative;   /* this is key */
  cursor: help;
}

span.tool span.tip {
  display: none;        /* so is this */
}

span.tool:hover span.tip {
  display: block;
  z-index: 100;
  position: absolute;
  top: 1.6em;
  left: 0;
  width: auto;
  padding: 3px 7px 4px 6px;
  border: 1px solid #336;
  background-color: #f7f7ee;
  font: normal 0.9em/1.2em arial, helvetica, sans-serif;
  text-align: left;
  color: #000;
}

#content span.tool::after {
  padding-left: 2px;            /* eye candy */
  content: url(/img/bubble.gif);
}

Implementasinya seperti berikut : <a href=”http://www.wikipedia.org/wiki/Wiki“><span class=”tool”>Wikipedia!<span class=”tip”><q>Wikipedia! on Wiki</q><br />http://www.wikipedia.org/wiki/Wiki</span></span></a>