# CSS

> The language that decides how a web page looks: colors, fonts, spacing, layout.

- Level: Basic
- Topics: Software
- URL: https://tidbit.legios.com.ar/css/
- In Spanish: [CSS](https://tidbit.legios.com.ar/es/css/)

**CSS** (Cascading Style Sheets) is the language that styles web pages. HTML says "this is a heading, this is a list"; CSS says "headings are dark blue and large, the list sits in a column on the right, and on a phone everything stacks". A CSS file is a list of **rules**, each one picking some elements and setting properties, like `h1 { color: navy; }`.

Keeping looks separate from content is the big idea. The same HTML can look completely different with another stylesheet, and one stylesheet can restyle thousands of pages at once. It also lets a single site adapt to a big monitor, a phone, a printer or a dark mode setting without rewriting the content.

The "cascading" part is how CSS settles conflicts. When several rules apply to the same element, the more specific one wins, and among equals the later one wins. That makes it powerful and, for beginners, sometimes puzzling: a color that "will not change" is usually being overridden by another rule somewhere else.

## An analogy

HTML is the furniture in a house; CSS is the interior designer's instructions: paint this wall green, put the sofa against the window, use smaller chairs in the small room.

## Keep in mind

- Styles HTML: colors, fonts, spacing, layout and animations.
- A rule picks elements with a selector and sets properties on them.
- When rules conflict, the more specific one wins (the cascade).
- Lets one page adapt to phones, big screens, print and dark mode.

## Go deeper

- [CSS: Cascading Style Sheets (MDN)](https://developer.mozilla.org/en-US/docs/Web/CSS)
- [CSS on Wikipedia](https://en.wikipedia.org/wiki/CSS)

## Related terms

- [HTML](https://tidbit.legios.com.ar/html/): The text format that describes what is on a web page: headings, paragraphs, links.
