CSS Introduction

CSS stands for Cascading Style Sheets. CSS is the language used to style and design web pages. It controls how HTML elements are displayed on the screen, including colors, fonts, spacing, layout, and responsiveness.

What is CSS?

CSS is a stylesheet language that describes the presentation of an HTML document. While HTML defines the structure of a web page, CSS defines how that structure looks visually.

How CSS Works with HTML

CSS works alongside HTML by selecting HTML elements and applying styles to them. These styles can be added inline, internally, or externally using CSS files.

Example
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
  color: red;
  text-align:center;
}

p {
  color: blue;
  font-size: 20px;
}
</style>
</head>
<body>

<h1>Introduction CSS</h1>
<p>This is my first CSS page.</p>

</body>
</html>
Try this code

The above example changes the color and size of all paragraph elements.

Why Use CSS?

Without CSS, web pages would appear plain and unstructured. CSS separates content from design, making websites easier to maintain.

  • Save time by styling multiple pages at once
  • Maintain a consistent design across the website
  • Reduce HTML code repetition
  • Improve page loading speed

CSS Versions

CSS has evolved over time to support modern web design. The most widely used version today is CSS3, which introduces animations, flexbox, grid layouts, and responsive design features.

What You Will Learn in This CSS Tutorial

Important: CSS is not a programming language. It does not perform logic or calculations. It is used only for styling and layout of web pages.