CSS IconsIntroductionWith the help of CSS icons, we can add icons to the HTML page from the icon library. All the icons available in the icon library can be formatted using the CSS properties. We can customize the icon based on size, color, shadow, etc. We can graphically represent the icons used in size, color, shadow, etc. There are three types of icons available on the internet. These are as follows.
We required the CDN link to make all the icons on the webpage. We can also customize the predefined icons with the help of CSS. ApproachTo use the icons first, we must link the CDN link inside the <head> tag. To achieve this, we have to follow the below steps.
Method 1: Font Awesome IconsWhen there is a need for awesome icons, we must add the link below inside the <head> tag. We must follow the syntax below when adding icons to the web page. Syntax: Example 1:In the below example, we use the font property with each icon class & whose value is set to 32px. Code: Output: Example 2:Output: Method 2: Google IconsWe can also insert the Google icons in our HTML web page. To do this, we have to insert the following code inside the head tag of our HTML code. Syntax: We must follow the syntax below to import the Google icon into our webpage. Example 3:In the below example, we will see the implementation of the "material-icons" class with the required icon. Code: Output: Example 4:In the below code, we will see the implementation of the "material-icons" class with the cloud shape. Code: Output: Method 3: Bootstrap IconsWe must link the link inside the <head> tag to use the bootstrap icon. Example 5:In the below example, we have implemented the font-size property and all the glyph icon class & all the value is set to different numbers. Code: Output: Example 6:In the below example, we have implemented the "glyph icon glyph icon-thumbs-up" class, which gives the output of the thumbs-up shape, and all the outputs have different shapes and numbers. Code: Output: Example 7:The below program contains some of the icons in a single web page. Output:
Next TopicCSS justify-content
|