CSS Basics

Table of Contents

CSS stands for Cascading Style Sheets. It is a stylesheet language used to describe the presentation of a web document written in HTML or XML.

The basic syntax of CSS consists of a selector and a declaration block. For example:

p { color: blue; font-size: 16px; }

Selectors are used to target HTML elements that you want to style. Common selectors include element selectors, class selectors, and ID selectors.

Properties define what aspects of an element you want to style, and values specify how you want to style them. For example, the 'color' property can have a value like 'blue' or '#FF0000'.

You can add CSS to HTML documents using the <style> element within the <head> section or by linking an external CSS file using the <link> element.

Review