CSS can be used inline, as well as internally and externally.

<p style="color:#0000ff;">I am blue</p>

CSS is applied to a single line or element using inline CSS.

<style>  
	h1{  
		background-color:red;
	}  
</style>

Internal CSS is used to implement CSS to a single document or page. It has the potential to alter all of the page's elements. It's written in the style tag in the HTML head section.

style.css

h1{  
background-color:red;
}

index.html

<link rel="stylesheet" href="style.css">

CSS can be applied to multiple pages or all pages using external CSS. All of the CSS code is written in a css file. The extension must be .css, such as style.css.