Install Bootstrap Icons—including SVGs, icon sprite, and icon fonts—with npm or Composer. Then, choose how you’d like to include the icons with the .
Show CDNInclude the icon fonts stylesheet—in your website
Bootstrap Icons are SVGs, so you can include them into your HTML in a few ways depending on how your project is setup. We recommend using a
1. CSSYou can also use the SVG within your CSS (be sure to escape any characters, such as
2 to
3 when specifying hex color values). When no dimensions are specified via
4 and
5 on the
6, the icon will fill the available space. The
7 attribute is required if you wish to resize icons with
8. Note that the
9 attribute is required.
AccessibilityFor purely decorative icons, add
0. Otherwise, provide an appropriate text alternative. Depending on which method you’re using to add the icons, and where you’re using them (e.g. as standalone images, or as the only content of a button or similar control), there are various possible approaches. Here are a few examples: How do I make a clickable icon in HTML?The <img> and the <a> tags together is the most common way of adding a clickable image link in HTML. In a webpage, after adding an image using the <img> tag, make it clickable by adding a <a> tag along with it. How do I add an icon to a label in HTML?How To Add Icons. To insert an icon, add the name of the icon class to any inline HTML element. The <i> and <span> elements are widely used to add icons. All the icons in the icon libraries below, are scalable vector icons that can be customized with CSS (size, color, shadow, etc.) How to create icon in CSS?The simplest way to add an icon to your HTML page, is with an icon library, such as Font Awesome. Add the name of the specified icon class to any inline HTML element (like <i> or <span> ). All the icons in the icon libraries below, are scalable vectors that can be customized with CSS (size, color, shadow, etc.) How to add image icon in button HTML?Approach 1: Using Font Libraries. Step 1 − Include the CSS file for the font library in your HTML file.. Step 2 − Use the appropriate class for the icon you want to use. ... . Step 3 − Add the class to your button's HTML code.. Step 4 − The complete code is given below (index.html file) −. |