Подсказки CSS3

by Andrey Dobrovoi

HTML

<div class="ttip" data-tooltip="Простая Подсказка">
	Наведите на меня...	
</div>

CSS

div {margin:10% auto;}
/* Tooltips */
.ttip {
  position: relative;
  cursor: pointer;
}
.ttip:after {
  display: block;
  background: #3085d6;
  border: 1px solid #3085d6;
  border-bottom: 0;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -ms-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 3px;
  padding: 0.5em 0.75em;
  width: auto;
  min-width: 130px;
  max-width: 500px;
  position: absolute;
  left: 0;
  bottom: 101%;
  margin-bottom: 8px;
  text-align: left;
  color: #fff;
  content: attr(data-tooltip);
  line-height: 1.5;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  -webkit-transition: opacity 0.1s ease;
  -moz-transition: opacity 0.1s ease;
  -o-transition: opacity 0.1s ease;
  transition: opacity 0.1s ease;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
  opacity: 0;
  pointer-events: none;
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #65a4e1), color-stop(100%, #3085d6));
  background-image: -webkit-linear-gradient(top, #65a4e1, #3085d6);
  background-image: -moz-linear-gradient(top, #65a4e1, #3085d6);
  background-image: -o-linear-gradient(top, #65a4e1, #3085d6);
  background-image: linear-gradient(top, #65a4e1, #3085d6);
  -webkit-box-shadow: 0 0 5px 0 rgba(48, 133, 214, 0.25);
  -moz-box-shadow: 0 0 5px 0 rgba(48, 133, 214, 0.25);
  box-shadow: 0 0 5px 0 rgba(48, 133, 214, 0.25);
}
.ttip:before {
  content: " ";
  width: 0;
  height: 0;
  position: absolute;
  bottom: 101%;
  left: 8px;
  border-top: 9px solid #3085d6 !important;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  -webkit-transition: opacity 0.1s ease;
  -moz-transition: opacity 0.1s ease;
  -o-transition: opacity 0.1s ease;
  transition: opacity 0.1s ease;
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
  opacity: 0;
  pointer-events: none;
}
.ttip:hover:after, .ttip:hover:before {
  -webkit-transition: opacity 0.4s ease;
  -moz-transition: opacity...