4. How to include CSS in the webpage?

1 – External Style Sheet: An external file linked to your HTML document: Using link tag, we can link the style sheet to the HTML page.

2 – Embed CSS with a style tag: A set of CSS styles included within your HTML page.

/*Add style rules here*/

Add your CSS rules between the opening and closing style tags and write your CSS exactly the same way as you do in stand-alone stylesheet files.

3 – Add inline styles to HTML elements(CSS rules applied directly within an HTML tag.): Style can be added directly to the HTML element using a style tag.

Inline Style

4 – Import a stylesheet file (An external file imported into another CSS file): Another way to add CSS is by using the @import rule. This is to add a new CSS file within CSS itself.

@import “path/to/style.css”;