What are the different types of CSS?

1. Inline CSS: Inline CSS is used to style individual elements. It is added directly to the HTML tag using the style attribute.

Example:

This is a heading

2. Internal/Embedded CSS: Internal/Embedded CSS is used to style the entire HTML document. It is added to the head section of the HTML document.

Example:

h1 {
color: red;
font-size: 20px;
}

3. External CSS: External CSS is used to style multiple HTML documents. It is stored in a separate CSS file and linked to the HTML document.

Example:

What is the purpose of using CSS?

CSS (Cascading Style Sheets) is a language used for describing the look and formatting of a document written in a markup language. It is most commonly used to style web pages written in HTML and XHTML, but can also be applied to any kind of XML document, including plain XML, SVG, and XUL.

CSS is used to control the presentation of a web document in a simple and easy way. For example, CSS can be used to define the size, color, and font of the text on a web page. It can also be used to define the size and position of elements on the page, such as images, tables, and even entire sections of the page. In addition, CSS can be used to create complex effects such as drop shadows, animations, and transitions.