The Bootstrap Icons library is a CSS file that needs to be linked using a <link> tag with rel="stylesheet". Option D correctly uses this method.
Option D tries to load a JavaScript file which does not exist for Bootstrap Icons.
Option D uses rel="icon" which is for favicons, not stylesheets.
Option D uses an inline style import which is valid CSS but not the recommended or standard way to include external CSS libraries in HTML.
Bootstrap Icons are used by adding class="bi bi-iconname" to an <i> or <span> element. Option A correctly uses <i class="bi bi-heart"></i>.
Option A uses a non-existent <icon> tag and incorrect attributes.
Option A uses a wrong class name that Bootstrap Icons do not recognize.
Option A uses an <svg> tag without the proper SVG content or classes.
<i class="bi bi-alarm"></i>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Bootstrap Icon Test</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css"> </head> <body> <i class="bi bi-alarm"></i> </body> </html>
Bootstrap Icons are font icons. When you use <i class="bi bi-alarm"></i> with the correct CSS included, a small alarm clock icon is rendered.
Option B is wrong because the icon classes do not display text.
Option B is wrong because 'bi-alarm' is a valid icon name.
Option B is wrong because Bootstrap Icons are not images but font glyphs.
All Bootstrap Icons have the class bi. Using the selector .bi targets all elements with that class regardless of tag.
Option A only targets <i> tags with class bi, but icons can be used on other tags.
Option A targets elements with both icon and bi classes, which is not standard for Bootstrap Icons.
Option A targets <svg> elements with class bi, but Bootstrap Icons are font icons, not SVG elements by default.
<button type="button" class="btn"> <i class="bi bi-play-circle"></i> </button>
Option C uses aria-label="Play" on the button to describe its purpose to screen readers and marks the icon as aria-hidden="true" so it is ignored by assistive technologies. This is the recommended approach.
Option C adds visible text 'Play' which is good but may not fit design needs if only icon is desired.
Option C hides the entire button from screen readers, making it inaccessible.
Option C adds role="img" to the icon but does not provide accessible text, so screen readers may not understand it.
