Bootstrap 5 TutorialLesson 26Free preview
BS5 Tooltip
This lesson is part of Bootstrap · All levels
Summary
A tooltip is a small box containing text that appears when a user scrubs an element with a cursor. Activate with data-bs-toggle="tooltip", define the position through data-bs-placement, and the content through the title attribute. The tooltip requires JavaScript activation because Bootstrap creates the object manually.
Key points
- Activate the tooltip with data-bs-toggle="tooltip".
- The position is set to data-bs-placement: top, right, bottom, left.
- The tooltip content uses the title or data-bs-title attributes in the latest version.
- The tooltip must be initialized via JavaScript with new bootstrap.Tooltip.
- Content should be short text, not interactive markup.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.