Loading...
Loading...
Learn how to add styles to HTML using CSS β colors, text alignment, and the cascade
CSS (Cascading Style Sheets) is the language that styles HTML. If HTML is the skeleton of a page, CSS is the clothes, makeup, and lighting. It controls colors, fonts, spacing, layout, animations β everything visual.
selector {
property: value;
}h1 {
color: blue;
font-size: 32px;
text-align: center;
}| Part | What it does | Example |
|---|---|---|
| `h1` | **Selector** β chooses which elements to style | `p`, `.class`, `#id` |
| `color` | **Property** β what aspect to change | `font-size`, `margin`, `background` |
| `blue` | **Value** β how to change it | `16px`, `red`, `1.5` |
| `{ }` | Declaration block β wraps all style rules |
<p style="color: red;">Red text</p>