Tooltips can be styled using CSS custom properties. For example, a tooltip may have
-
- A tabindex of 0.
-
This demo measures the time needed to render 10000 tooltip elements then toggle the first tooltip.
- -
- Tooltips can be anchored to the left:
-
- Tooltips can have content which wraps lines, but this is discouraged,
- because tooltips are meant to contain as little content as possible.
- When tooltips have lengthy content anchored to the left, it looks like this:
-
A tooltip may contain
- code.
-
- content slot.
- Slotted content must be phrasing content, so no <p>s.
-
A tooltip may contain
+ code.
+
+ content slot.
+