🎨 CSS
5th Grade 💻 Coding
CSS is the language that decides how a web page looks: colors, sizes, fonts, spacing, borders, and how everything is arranged on the screen.
A CSS rule is made of a selector (what you’re styling) followed by curly braces with properties and values. h1 { color: purple; } makes every main heading purple. body { background: lightyellow; } colors the page background. Each property ends with a semicolon.
CSS appeared in the mid-1990s to separate a page’s content from its design. The big advantage: you style things once, and every page on the site looks consistent. Want to change the heading color on a hundred pages? Change one line. CSS also adapts pages to the screen size, so the same site looks good on a phone and on a computer.
For example
p { font-size: 20px; }makes the text bigger in every paragraph.- On most websites, CSS sets the colors, the rounded corners on buttons and the layout on a phone.
- The same HTML with two different CSS files can look like a dark space website one time and a colorful flower website the next.
📌 Remember: CSS = the page’s clothes. HTML = its body.
Quick quiz
What does CSS do?
What will h1 { color: purple; } do?
What is the advantage of CSS on a site with many pages?