What are the different ways to apply CSS to a web page?

1. Inline CSS: This is the simplest way to apply CSS to a web page. With inline CSS, you apply the style directly to the HTML element using the style attribute and CSS declarations. For example:

This is a heading

2. Internal or Embedded CSS: Internal CSS is used when you want to apply a unique style to a single HTML page. You can define internal CSS in the section of an HTML page, by using the tag. For example:

h1 {
color: blue;
font-size: 24px;
}

3. External CSS: External CSS is used when you want to apply the same style to multiple HTML pages. You can link to an external CSS file using the tag. For example:

What is the difference between resetting and normalizing a CSS?

Resetting a CSS is a process of removing all the default styling of HTML elements and setting them to a common baseline. This ensures that all elements are styled consistently across different browsers. For example, if you reset the CSS, all

tags would have the same font size, line height, and font weight, regardless of the browser.

Normalizing a CSS is a process of preserving useful default styles while also correcting cross-browser inconsistencies. It is a more modern approach than resetting a CSS, as it allows for more flexibility in styling elements. For example, if you normalize the CSS,

tags could have different font sizes, line heights, and font weights, depending on the browser.

What is the difference between an ID and a class?

ID: An ID is an attribute that is used to uniquely identify an element on a web page. An ID can be used to identify one element, or multiple elements if the same ID is used for each element.

Example:

This is the introduction paragraph.

Class: A class is an attribute that is used to group elements on a web page. A class can be used to identify one element, or multiple elements if the same class is used for each element.

Example:

This is the introduction paragraph.

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.