CSS Basics
Table of Contents
What is CSS?
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.
CSS Syntax
The basic syntax of CSS consists of a selector and a declaration block. For example:
p { color: blue; font-size: 16px; }
Selectors
Selectors are used to target HTML elements that you want to style. Common selectors include element selectors, class selectors, and ID selectors.
Properties and Values
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'.
Adding CSS to HTML
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.