Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn What CSS Is and Why It Matters | Getting Started with CSS
CSS Fundamentals

bookWhat CSS Is and Why It Matters

Swipe to show menu

Prerequisites
Prerequisites

HTML defines the structure and content of a web page. CSS defines how that content is presented.

While HTML organizes elements such as headings, paragraphs, and images, CSS controls their appearance, including colors, spacing, fonts, alignment, and layout.

Together, HTML and CSS form the foundation of modern web development.

What Is CSS?

Note
Definition

CSS stands for Cascading Style Sheets. It is a stylesheet language used to describe how HTML elements should be displayed in a browser.

With CSS, you can:

  • Change text and background colors;
  • Adjust spacing between elements;
  • Control fonts and typography;
  • Create layouts;
  • Add visual effects.

CSS does not change the structure of a document. It controls how that structure looks.

Basic CSS Syntax

A CSS rule consists of a selector and a declaration block.
Example:

p {
  color: purple;
  background-color: green;
}

Explanation:

  • p is the selector. It targets all <p> elements;
  • color: purple; sets the text color;
  • background-color: green; sets the background color.

Each declaration follows this format: property: value;

You will explore selectors, properties, and values in detail in upcoming chapters.

question mark

What do we need CSS for?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 1. Chapterย 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Sectionย 1. Chapterย 1
some-alt