Types of CSS
- There are mainly three types of CSS, Inline CSS, Internal CSS and External CSS.
- Inline CSS written in the opening tag of the HTML element by using style attribute and we can write our CSS for every element of HTML.
- Internal CSS is written in the head tag of HTML by using style tag. This stylesheet is included in the HTML file.
- External CSS is written in the external file with .css extension. And this is almost the same as Internal CSS but this is a different CSS file.
What is Inline CSS?
Inline CSS is written in the opening tag in HTML element using the style attribute. But it is difficult to write CSS for every element individually. In Inline CSS the CSS style is written within double quotes " " like this style=" ".
Syntax of Inline CSS
In the given syntax style attribute is used to set Inline CSS, color is the property and red is the value. (Watch YouTube video for better understanding in Hindi)
What is Internal CSS?
Internal CSS is written in the head tag of an HTML element by using style tag. This saves a lot of time because in this we can target multiple elements and can apply the same style to them.
Syntax of Internal CSS
What is External CSS?
External CSS is written in the external file with a .css extension. And this is almost the same as Internal CSS but this is a different CSS file. And this will be added using <link> tag. This style can be used on multiple HTML pages by linking them with <link> tag. And this file is added within head tag.
Syntax of Internal CSS
Code Described in the video