Tutorial

Tooltips with Bootstrap

While this tutorial has content that we believe is of great benefit to our community, we have not yet tested or edited it to ensure you have an error-free learning experience. It's on our list, and we're working on it! You can help us out by using the "report an issue" button at the bottom of the tutorial.

Help your users understand stuff better in your app or website with tooltips:

<span title=”Push it real good” data-toggle=”tooltip”>
  Push It
</span>

Initializing them

You’ll need to initialize tooltips via JavaScript:

$(document).ready(function(){
  $('[data-toggle="tooltip"]').tooltip();
});

Tooltip placement

Want your tooltip over, under or to the side of your element? Add the data-placement attribute on your element:

<a href=”#” data-toggle=”tooltip”
data-placement=”left”
title=”Knock you out”>
  Mama said
</a>

Quick tip

Don’t forget to include jQuery and bootstrap.js as these are necessary for tooltips to work.

0 Comments

Creative Commons License