An icon font is a special font that contains symbols or icons instead of letters. You can use it like text to show icons on a webpage.
Click to reveal answer
beginner
How do you include Bootstrap Icons in your project?
You add a link to the Bootstrap Icons CSS file in your HTML <head>. For example: <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet"/>
Click to reveal answer
beginner
How do you display a Bootstrap icon in HTML?
Use an <i> or <span> tag with the class for the icon. For example: <i class="bi bi-alarm"></i> shows an alarm icon.
Click to reveal answer
intermediate
Why use icon fonts instead of images?
Icon fonts scale well on all screen sizes, load fast, and can be styled with CSS colors and sizes easily, unlike images.
Click to reveal answer
beginner
How can you change the size and color of a Bootstrap icon?
Use CSS properties like font-size and color on the icon element. For example: <i class="bi bi-alarm" style="font-size: 2rem; color: red;"></i>
Click to reveal answer
How do you add Bootstrap Icons to your webpage?
AUse <svg> tags only
BAdd a <script> tag for Bootstrap Icons JavaScript
CDownload icons as images and use <img> tags
DAdd a <link> tag to the Bootstrap Icons CSS in the <head>
✗ Incorrect
Bootstrap Icons are added by linking their CSS file in the <head> section.
Which HTML element is commonly used to show a Bootstrap icon?
A<div>
B<i> or <span>
C<img>
D<button>
✗ Incorrect
Icons are usually shown using <i> or <span> tags with the correct icon class.
What class prefix do Bootstrap Icons use?
Abi-
Bfa-
Cicon-
Dglyph-
✗ Incorrect
Bootstrap Icons use the prefix 'bi-' for their icon classes.
How can you change the color of a Bootstrap icon?
AChange the image file color
BUse the 'background-color' property
CUse the CSS 'color' property on the icon element
DYou cannot change icon colors
✗ Incorrect
Icon fonts respond to the CSS 'color' property to change their color.
Why are icon fonts preferred over images for icons?
AThey scale well and are easy to style
BThey cannot be styled with CSS
CThey are slower to load
DThey use more bandwidth
✗ Incorrect
Icon fonts scale smoothly and can be styled easily with CSS, unlike images.
Explain how to add and use a Bootstrap icon in a webpage.
Think about linking CSS and using classes on elements.
You got /3 concepts.
Describe the benefits of using icon fonts like Bootstrap Icons instead of image icons.
Consider how fonts behave compared to images.
You got /4 concepts.
Practice
(1/5)
1. What is the correct way to add a Bootstrap icon for an alarm in your HTML?
easy
A. <img src='alarm.svg' class='bi'>
B. <icon name='alarm'></icon>
C. <span class='icon-alarm'></span>
D. <i class='bi bi-alarm'></i>
Solution
Step 1: Understand Bootstrap icon usage
Bootstrap icons use the i tag with classes starting with bi to display icons.
Step 2: Identify the correct class for alarm icon
The alarm icon uses the class bi-alarm, so the full class is bi bi-alarm.
Final Answer:
<i class='bi bi-alarm'></i> -> Option D
Quick Check:
Bootstrap icon tag = <i class='bi bi-iconname'></i> [OK]
Hint: Use <i> tag with 'bi bi-iconname' classes [OK]
Common Mistakes:
Using <icon> tag which is not valid
Using <span> without correct classes
Using <img> instead of icon font
2. Which of the following is the correct syntax to include a Bootstrap icon for a 'check' mark?
easy
A. <i class='bi bi-check'></i>
B. <span class='bi-check'></span>
C. <i class='bi-check'></i>
D. <icon class='bi bi-check'></icon>
Solution
Step 1: Recall Bootstrap icon class format
Bootstrap icons require two classes: bi and the specific icon name like bi-check.
Step 2: Check the tag and classes
The correct tag is i with both classes: bi bi-check.
Final Answer:
<i class='bi bi-check'></i> -> Option A
Quick Check:
Two classes: 'bi' + 'bi-iconname' on <i> tag [OK]
Hint: Always use both 'bi' and 'bi-iconname' classes [OK]
Common Mistakes:
Using only one class instead of two
Using wrong tag like <span> or <icon>
Missing the 'bi' base class
3. What will be the visual result of this HTML snippet?
<i class='bi bi-alarm'></i> Alarm
medium
A. A broken image icon followed by the text 'Alarm'
B. Only the text 'Alarm' without any icon
C. A text 'Alarm' with a small alarm clock icon before it
D. An error message because i tag is invalid
Solution
Step 1: Understand icon font rendering
The i tag with classes bi bi-alarm renders a scalable alarm icon before the text.
Step 2: Check the text placement
The text 'Alarm' appears after the icon, so the user sees the icon followed by the word.
Final Answer:
A text 'Alarm' with a small alarm clock icon before it -> Option C
Quick Check:
Icon + text = icon visible before text [OK]
Hint: Icon class shows icon before text inside same element [OK]
Common Mistakes:
Thinking icon won't show without <img>
Assuming <i> tag is invalid
Expecting icon after text instead of before
4. You wrote this code but the icon does not appear:
<i class='bi-alarm'></i>
What is the likely problem?
medium
A. The class 'bi-alarm' is incorrect; it should be 'icon-alarm'.
B. You forgot to include the Bootstrap Icons CSS file in your page.
C. The i tag cannot be used for icons.
D. You need to use <span> instead of <i>.
Solution
Step 1: Check icon class usage
The class 'bi-alarm' alone is not enough; Bootstrap icons require both 'bi' and 'bi-alarm' classes.
Step 2: Verify CSS inclusion
Even with correct classes, if the Bootstrap Icons CSS file is missing, icons won't show.
Final Answer:
You forgot to include the Bootstrap Icons CSS file in your page. -> Option B
Quick Check:
Missing CSS file = icons not visible [OK]
Hint: Always include Bootstrap Icons CSS file in your HTML [OK]
Common Mistakes:
Using only one class instead of two
Not linking the Bootstrap Icons CSS file
Thinking <i> tag is invalid for icons
5. You want to add a responsive icon button that shows a 'trash' icon and a label 'Delete' side by side, with the icon scaling nicely on all screen sizes. Which is the best approach?
hard
A. <button class='btn btn-danger'><i class='bi bi-trash'></i> Delete</button>
B. <button class='btn btn-danger'><img src='trash.svg' alt='trash icon'> Delete</button>
C. <button class='btn btn-danger'><span class='icon-trash'></span> Delete</button>
D. <button class='btn btn-danger'><i class='icon-trash'></i> Delete</button>
Solution
Step 1: Choose scalable icon method
Bootstrap icons use i tag with classes like bi bi-trash for scalable vector icons that scale well on all devices.
Step 2: Combine icon with button and label
Placing the icon inside the button before the text label ensures they appear side by side and respond to button styling.
Final Answer:
<button class='btn btn-danger'><i class='bi bi-trash'></i> Delete</button> -> Option A
Quick Check:
Use <i> with 'bi bi-icon' inside button for responsive icons [OK]
Hint: Use inside buttons for scalable icons [OK]
Common Mistakes:
Using <img> which may not scale well
Using wrong classes like 'icon-trash'
Not placing icon inside button element
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.