Inline CSS

Inline CSS

When we write inline styles, we write the CSS in the HTML file, directly inside an element's tag using a style attribute.

An inline style may be used to apply a unique style for a single element.

To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.


<htmltag style="cssproperty1:value; cssproperty2:value;"></htmltag>


   <!DOCTYPE html>
<h1 style = "color:blue;">This is inline CSS </h1>
Try it with the Editor

Disadvantages of Inline CSS