Tooltip Just With CSS


CSS Tooltip

CSS Tooltip

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&gt;

Mari Berdiskusi Bersama

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s