Home > Mobile >  How can i add the tooltiptext in button? in html -
How can i add the tooltiptext in button? in html -

Time:07-20

I wrote " Home<i fa-3%> "

But it does not work... Plz answer my Quz--and if u can, show me the syntax example

CodePudding user response:

Use title attribute like title="Cat chattering ekekekek"

CodePudding user response:

Tooltips are little boxes containing helpful text that appear when you hover over certain elements in a web page. They’re a useful UI component for providing additional information to users without having to clutter the interface. In this tutorial we’ll be creating a simple tooltip using HTML & CSS with no JavaScript required.
Following code is the example of how to add tooltip text.

      <style>
/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
 
  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}
</style>

<div >Hover over me
  <span >Tooltip text</span>
</div>

I hope you'll like this.

  • Related