CSS (Cascading Style Sheets) is the language that styles a web page. HTML builds the structure; CSS decides how it looks.
What can CSS do?
- Change colours, fonts and text size
- Add spacing, borders and backgrounds
- Build layouts with columns and grids
- Make pages work on mobiles (responsive design)
- Add transitions and animations
Why "cascading"?
Many rules can target the same element. The browser combines them in a fixed order (the cascade) to decide which style wins.
One file, many pages
With one external CSS file you can change the look of a whole website by editing a single file.
Example
Example — Your first CSS
HTML
<!DOCTYPE html>
<html>
<head>
<style>
body { background: #f0f6ff; font-family: Arial, sans-serif; }
h1 { color: #1f386b; text-align: center; }
p { color: #444; font-size: 18px; }
</style>
</head>
<body>
<h1>Hello CSS</h1>
<p>This page is styled with CSS.</p>
</body>
</html>
The style block changes the background, the heading colour and the paragraph text.
Try it Now »