Welcome to Our Free Tutorial!

Inline - CSS

CSS Inline has the highest priority out of external, internal, and inline CSS. CSS Inline create every HTML tag. If you want add style inside an HTML tag all you have do CSS style properties with in the HTML attribute.

Syntax:

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

CSS Code:

<p style="background: yellow; color: blue;"> 
The Background color is yellow and text color is blue with inline CSS </p>

Display:

The Background color is yellow and text color is blue with inline CSS


When we use CSS inline you must sure that not use quotations within your inline CSS. If you use quotations the browser will not support your style value.

CSS Code:

<p style="background: url("../images/internet.jpg");">
This is WRONG </p>

<p style="background: url( ../images/internet.jpg );">
This background image is CORRECT  CSS Code </p>

Display:

This background image is CORRECT CSS Code