Types of CSSCSS (Cascading Style Sheet) describes the HTML elements which are displayed on screen, paper, or in other media. It saves a lot of time. It controls the layout of multiple web pages at one time. It sets the font-size, font-family, color, background color on the page. It allows us to add effects or animations to the website. We use CSS to display animations like buttons, effects, loaders or spinners, and also animated backgrounds. Without using CSS, the website will not look attractive. There are 3 types of CSS which are below:
1. Internal CSSThe Internal CSS has tag in the section of the HTML document. This CSS style is an effective way to style single pages. Using the CSS style for multiple web pages is time-consuming because we require placing the style on each web page. We can use the internal CSS by using the following steps: 1. Firstly, open the HTML page and locate the 2. Put the following code after the |
After adding the internal CSS, the complete HTML file looks like the following:
We can also use the selectors (class and ID) in the style sheet.
Example:
Pros of Internal CSS
Cons of Internal CSS:
In external CSS, we link the web pages to the external .css file. It is created by text editor. The CSS is more efficient method for styling a website. By editing the .css file, we can change the whole site at once.
To use the external CSS, follow the steps, given below:
1. Create a new .css file with text editor, and add Cascading Style Sheet rules too.
For example: