Categories
HTML

How to use complex HTML with Twitter Bootstrap’s Tooltip?

Spread the love

To use complex HTML with Twitter Bootstrap’s Tooltip, we set the data-html attribute to true.

For instance, we write

<span
  rel="tooltip"
  data-toggle="tooltip"
  data-html="true"
  data-title="<table><tr><td style='color:red;'>complex</td><td>HTML</td></tr></table>"
>
  hover over me
</span>

to set the data-html attribute to true to let us add HTML as the tooltip’s content.

And we set the data-title attribute to the tooltip content.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *