Skip to main content

CSS

CSS is the stylesheet language used to control how web pages look.

What Is CSS

CSS stands for Cascading Style Sheets. It controls colors, typography, spacing, layout, animations, and responsive behavior.

HTML describes content. CSS describes presentation.

How To Use CSS

Write CSS rules that select HTML elements and apply styles to them.

You can add CSS inside an HTML file, link an external .css file, or use CSS through a framework or component system.

Basic Example

body {
margin: 0;
font-family: system-ui, sans-serif;
line-height: 1.5;
}

.button {
background: #2563eb;
color: white;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
}

Common Concepts

  • Selectors target elements.
  • The cascade decides which rule wins.
  • Flexbox and Grid create layouts.
  • Media queries adapt pages to different screen sizes.

What To Learn Next

Learn the box model, positioning, Flexbox, Grid, responsive design, custom properties, and accessibility-friendly styling.