There is three-way to add CSS in an HTML document.
The CSS has written in a single line to apply CSS is called Inline CSS.It is done by using the style attribute.Example:
An Internal CSS style is only applied for the same page. The CSS rule is written inside an <style> element and placed between the <head> tag.Example:
External CSS is used when we using multiple HTML pages with similar CSS files. This can be done by having an external CSS file. The external CSS file must save with the extension with .css. It is a good way to apply CSS for your HTML page. The main advantages of external CSS are, you can change all the page style from a single CSS file.Example: