Working examples demonstrating icon usage methods, sizing, coloring, and alignment techniques.
Use <i class="bi bi-*"> for icon fonts. This is the recommended method
for most use cases due to simplicity and automatic sizing with text.
Icons use bi bi-{name} pattern. Add -fill suffix for filled variants.
Reference icon SVG files directly via <img> element. Ideal for email templates,
static pages, and content management systems where CSS/font dependencies should be avoided.
Reference icons directly from jsDelivr CDN.
Include icons via CSS background-image or mask-image.
Useful for decorative icons applied via CSS classes without markup changes.
Icons display as background images with fixed colors. Cannot inherit text color.
Icons inherit the parent's text color via currentColor.
Requires vendor prefixes for Safari (-webkit-mask-*).
Same icon class with different parent text colors.
role="img" and aria-label if the icon conveys meaning.
Icons scale with font-size. Use inline styles, Bootstrap utilities, or custom CSS classes.
Use .fs-1 through .fs-6 utilities for consistent sizing.
Define reusable size classes: .icon-lg, .icon-md, .icon-sm.
Icons inherit text color. Use Bootstrap utilities, inline styles, or CSS classes.
Icons automatically inherit the parent element's text color.
Icons may need alignment adjustments when placed inline with text.
Use vertical-align: -0.125em for precise baseline alignment with text.
Copy SVG code directly from icons.getbootstrap.com
for maximum control. Uses currentColor for automatic color inheritance.
Define icons once as symbols, reference multiple times with <use>.
Ideal for pages with many repeated icons.
Reference symbols defined in the same document with <use href="#id">.
Reference an external sprite file with <use href="path/bootstrap-icons.svg#icon-name">.
<svg class="bi" width="32" height="32" fill="currentColor">
<use href="bootstrap-icons.svg#heart"/>
</svg>
Practical examples combining sizing, coloring, and alignment techniques.
Inline with body text (inherits size)