How To Use CSS

tutorial and example
tutorial and example

You can use CSS(Cascading Style Sheet) in four ways.

These are given below:

The given above CSS type, in which various technique will be used. These are different from each other and their different advantages.

  • Embedded or Internal CSS
  • Inline style
  • External style sheet
  • Imported CSS

Embedded or Internal Style Sheet

An Embedded or Internal Style Sheet is used in only one single page. It is define within <style> element inside the <head> section.

Let us see an example of CSS embedded or internal style sheet:

Example of Internal Style Sheet

Try Now

Inline Style Sheet

An Inline Style Sheet used with a unique style for a single element. You must have to used style attribute to the element.

Let us see an example of CSS inline style sheet:

External Style Sheet

In External Style Sheet can use <linl> element to include an external stylesheet file. The style file extension must be .css . you can access style sheet in different web pages by using link the style sheet.

Let us see an example of CSS external style sheet:

Import Style Sheet

In Import Style Sheet, @import is used to import an external stylesheet with in <head> element.

Let us see an example of CSS import style sheet: