Introduction to CSS

Cascading Style Sheets (CSS) is a stylesheet language used to control the look and layout of HTML documents. CSS allows you to apply styles to web pages, making them visually appealing and easier to read.

What is CSS?

CSS stands for Cascading Style Sheets. It describes how HTML elements should be displayed on screen, paper, or in other media. CSS is designed to separate the content of a web page from its presentation, allowing for easier maintenance and styling.

Why Use CSS?

How CSS Works

CSS rules are applied to HTML elements using selectors and properties. A CSS rule consists of a selector and a declaration block:

        
/* This is a CSS rule */
selector {
  property: value;
}
        
    

In this example, `selector` is the HTML element to which the style is applied, and `property: value;` defines the style property and its value.