agyanadda@gmail.com

CSS Introduction

CSS Basics 1 min read Updated Dec 1, 2026 Topic 1 of 39

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 »

Test Yourself With Exercises

Exercise 1 Multiple Choice

What does CSS stand for?

Exercise 2 True / False

CSS is used to build the structure of a page, and HTML is used to style it.

Exercise 3 Fill in the Blank

CSS rules are written inside the HTML ___ tag when placed in the head.

Frequently Asked Questions

No. CSS is a style sheet language. It describes how elements look; it has no loops or logic like JavaScript.