Types of CSS
By Saket Bhatnagar••Beginner to Intermediate
types of Css
Inline CSS
- 1The Css code we write inside the opening tag is called as Inline Css.
- 2To write Inline Css we use 'style' attribute.
Internal CSS
- 1The Css code we write inside the Html document is called as Internal Css,
- 2Here, we have to write css code inside <style></style> tag.
- 3Style tag
- It is container tag.
- It is provided by Html to insert css code in document only. - 4We have to place the style tag within the head tag.
- 5
Syntax:-
1<head>2 <style>3 -- css code --4 </style>5</head>
External Css
- 1The Css we are writing in a separate/different document is called as External Css.
- 2To write External Css we have to create a separate document and this document should be saved with .css extension.
- 3Now, to link external Css document with the Html we have to use <link> Tag (It is a non container tag).
- 4<link> tag is used to attach external files to our webpage.
- 5We have to use <link> tag within the head tag.
- 6
Syntax:-
1<link rel='stylesheet' href='path-of-Css-file'>
Css Syntax
- 11Selector {2 property: value;3}
- 2 Selector:- It is used to target Html Element on which we want to apply styling.
- 3Property:- It is the property/styling we want to apply on the targetted element.
- 4 Value:- It is the value that we apply for the certain property.
- 1