Module 3: CSS Fundamentals
- Write CSS selectors to target specific HTML elements
- Explain the CSS box model of margin, border, padding, and content
- Apply colors, fonts, and spacing to a page
CSS, Cascading Style Sheets, controls the visual presentation of HTML -- colors, fonts, spacing, and positioning -- using selectors that target specific elements, classes written as .classname, or IDs written as #idname. The box model describes how every HTML element is rendered as a rectangular box made of four layers, from inside out: content, padding (space inside the border), border, and margin (space outside the border) -- understanding this model is essential for controlling spacing correctly instead of guessing. 'Cascading' refers to how CSS rules can come from multiple sources, such as browser defaults, external stylesheets, and inline styles, with more specific or later-declared rules generally overriding earlier, less specific ones, which explains why a style sometimes 'doesn't apply' until you understand which rule is winning.
1. A CSS class selector is written with which symbol in front of the name?
2. In the CSS box model, which layer sits directly outside the border?
3. The word 'cascading' in CSS refers to: