Inline CSS

The Inline CSS is used to apply style sheets in HTML document.

Syntax:

<p style="color:green">This is a paragraph</p>

See this example:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example of HTML CSS Inline</title> 
</head>
<body>  
	 <p style="color:green">This is a paragraph</p> 
 </body>
</html>

Disadvantages of Inline CSS

  • Using Inline CSS, your documents would quickly become bloated and very hard to maintain.
  • These styles cannot be reused anywhere else.
  • Inline CSS does not provide browser cache advantages.