reading-notes

CSS

What is the purpose of CSS?

CSS (Cascading Style Sheets) is a style sheet language used to describe the presentation of HTML (Hypertext Markup Language) and XML (Extensible Markup Language) documents. The purpose of CSS is to separate the presentation of a document from its content, allowing developers to apply consistent styles and layout across multiple pages.


What are the three ways to insert CSS into your project?

There are three ways to insert CSS into your project:

External CSS: Create a separate CSS file with the .css extension and link it to your HTML document using the <link> tag in the <head> section. For example:

Internal CSS: Insert CSS rules directly into the <head> section of your HTML document using the <style> tag. For example:

Inline CSS: Add CSS styles directly to an HTML element using the style attribute.


Write an example of a CSS rule that would give all <p> elements red text.

p {

color: red;

}