Types of CSS

You are currently viewing Types of CSS

Three different types of CSS are inline CSS, internal CSS, and External CSS. Briefly explain about the types of CSS are as follows.

External CSS Types of CSS

An external style sheet is defined in a separate file stored with the .css extension. It is very useful when the style applied to many pages. The external style sheet file is then linked to the web page using the <link> tag is written inside the head section.

Example

<head>
   <link rel="stylesheet" type="text/css" href="style.css">
</head>

In the above example, the browser will read the style definitions from the file style.css and format the document according to it. An external style sheet can be written in any text editor. The file should not contain any HTML tags.

Internal style sheets

An internal style sheet is inserted in the head section of a web page. It only affects the web page in which it is inserted. It is inserted in a web page by using the <style> tag.

Example

<head>
   <style type="text/css">
      H4{color:red;}
      H5{color:yellow;}
   </style>
</head>

Inline styles

Inline style is applied to an individual tag. It modifies the attributes of a tag in the current occurrence of that tag. If the tag is used again, the default style of the tag will be used. The attributes are given in the opening tag.

Example

<p style="color:green">it’s example pharagraph</p>

The above example displays the contents of the paragraph in red color. But this attribute is valid for current occurrence only. If the <p> tag is used again in the document, it will display the contents in the default color.

types of css
types of css

Reference

If you want to learn more about CSS visit the official website: Visit

visit the CSS tutorial list. And make strong your CSS concept. Click here. wuschools.com is always written about the CSS concept for the CSS lover. Ang writes about how CSS makes your life easy if you are a web site developer. We help you to continue your learning.

Leave a Reply