HTML HTML CSS Internal Css

What is CSS?

CSS stands for Cascading Style Sheets. It defines how Html elements are displayed in web browser.(color and style etc). Browser format web pages according to information in CSS.


<p style="background-color:green;color:white;font-size:20px;">This is paragraph about CSS. CSS stands for Cascading Style Sheet.</p>


This is paragraph about CSS. CSS stands for Cascading Style Sheet.

Types Of CSS

  1. Inline CSS
  2. Internal CSS
  3. External CSS

Inline CSS:-

Inline CSS is applied to Html elements using style attribute.


<p style="background-color:green;color:white;">This is paragraph with inline CSS.</p>


This is paragraph with inline CSS.

Internal CSS:-

It is defined in <head> tag of Html document.(<style> tag within <head> tag.) It define styles for single html element. This element having same styles, where this element is used.


<html><head><style> h6{color:white; background-color:red;} </style></head><body> <h6>Internal CSS</h6> </body> </html>


Internal CSS

External CSS:-

External CSS define styles for one or more pages. This is written in external text file with extension css and linked with Html pages. Add link in <head> section.

External CSS Syntax

<html> <head> <link rel="stylesheet" href="File path"> </head> <body> </body> </html>
HTML Internal Css Chapter Next »