Comprehensive examples of Bootstrap 5.3's link styling helpers including colored links, opacity, underlines, focus rings, icon links, and stretched links.
Use .link-* classes to apply theme colors to links with hover darkening.
All 9 color variants automatically adjust on hover.
Control link transparency with .link-opacity-* classes.
Combine with -hover suffix for interactive effects.
Use .link-opacity-*-hover to change opacity on hover.
Combine with static opacity for reveal effects.
Fine-tune link underlines with color, opacity, and offset utilities.
Apply theme colors to underlines with .link-underline-* classes.
Important: Underline opacity utilities require the base
.link-underline class to function properly.
Combine .link-underline-opacity-0 with .link-underline-opacity-*-hover
to reveal underlines on hover.
Adjust the distance between text and underline with .link-offset-* classes.
Values range from 1 (closest) to 3 (furthest).
Combine multiple underline utilities for custom effects.
Customize focus indicators with .focus-ring utilities.
Tab through elements below to see focus rings in action.
The base .focus-ring class applies a subtle focus indicator.
Apply theme colors with .focus-ring-* classes.
Use the --bs-focus-ring-color CSS variable for custom colors.
Override button focus styles by combining .focus-ring with buttons.
Combine icons with text using .icon-link.
Add .icon-link-hover for animated effects on hover.
Add .icon-link-hover to animate the icon on hover.
The icon moves slightly in its natural direction.
Override the animation direction with --bs-icon-link-transform.
Combine with link color and underline utilities for themed icon links.
Make an entire container clickable by adding .stretched-link to a nested link.
The parent container must have position: relative.
Cards already have position: relative, so stretched links work out of the box.
Add .position-relative to the clickable container.
Entire row is clickable. This pattern is great for featured content sections.
Read more
Any element works as long as it has .position-relative.
Add position-relative to the parent element to define the clickable area.
Each card is independently clickable.
position: relative (cards have this by default).stretched-link per containerposition: relative and higher z-index