CSS · Chapter 1 of 44
CSS Introduction
CSS stands for Cascading Style Sheets. It describes how HTML elements should be displayed — colors, fonts, spacing, layout, and more.
CSS separates presentation from structure, letting you style many pages consistently from one stylesheet.
What CSS does
CSS controls the visual appearance of HTML: colors, fonts, sizes, spacing, and positioning of elements on the page.
Why use CSS
Without CSS, browsers display plain, unstyled HTML. CSS lets you create attractive, responsive, and consistent designs across an entire site.
Example 1 (css)
h1 {
color: blue;
text-align: center;
}Output
A centered, blue headingThis rule selects all <h1> elements and sets their color and alignment.
Key points
- CSS stands for Cascading Style Sheets.
- CSS styles HTML elements' appearance.
- CSS separates content from presentation.
- 'Cascading' means rules can override each other based on specificity and order.
💡 Note: CSS was first proposed in 1994 and is maintained by the W3C.
