1

I want to create tooltip via button, but I can not insert html tag to give line break down. can anyone help me solve this problem?

[data-title]:hover:after {
  opacity: 1;
  transition: all 0.1s ease 0.5s;
  visibility: visible;
}

[data-title]:after {
  content: attr(data-title);
  position: absolute;
  bottom: -3em;
  right: 40%;
  padding: 4px 4px 4px 8px;
  color: grey;
  white-space: nowrap;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  -moz-box-shadow: 0px 0px 4px deepskyblue;
  -webkit-box-shadow: 0px 0px 4px deepskyblue;
  box-shadow: 0px 0px 4px deepskyblue;
  background-image: -moz-linear-gradient(top, #fff, #fff);
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #cccccc));
  background-image: -webkit-linear-gradient(top, #fff, #fff);
  background-image: -moz-linear-gradient(top, #fff, #fff);
  background-image: -ms-linear-gradient(top, #fff, #fff);
  background-image: -o-linear-gradient(top, #fff, #fff);
  opacity: 0;
  z-index: 99999;
  visibility: hidden;
  font-size: 11px;
}

[data-title] {
  position: relative;
}
<a href="<?=get_the_permalink()?>">
  <button class="btn" data-title="1) A <br> 2) B">Lihat Detail</button>
</a>
Turnip
  • 35,836
  • 15
  • 89
  • 111

0 Answers0