Tooltips
Custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-attributes for local title storage.
Enable tooltips everywhere
One way to initialize all tooltips on a page would be to select them by their data-toggle
attribute:
All four directions
Four positioning options are available: top, right, bottom, and left aligned.
<!-- Top (default) -->
<button type="button" class="btn btn-light" data-toggle="tooltip" data-placement="top" title="Tooltip on top">
Tooltip on top
</button>
<!-- Right -->
<button type="button" class="btn btn-light" data-toggle="tooltip" data-placement="right" title="Tooltip on right">
Tooltip on right
</button>
<!-- Bottom -->
<button type="button" class="btn btn-light" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">
Tooltip on bottom
</button>
<!-- Left -->
<button type="button" class="btn btn-light" data-toggle="tooltip" data-placement="left" title="Tooltip on left">
Tooltip on left
</button>
HTML content
Tooltip can also contain custom HTML contents
<button type="button" class="btn btn-theme" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
Files required:
Type | Files |
---|---|
Custom SCSS | /src/scss/inc/bootstrap-overrides/_tooltips.scss |