Apply styles with readable rules.
- external stylesheet
- selectors
- declarations
- properties
- comments
- CSS parsing
Connect styles.css to a page and style text, links, and a section.
- Open the result in a browser and inspect the HTML and computed CSS.
- Test at narrow and wide widths and use the keyboard for interactive elements.
- Write down one thing you changed after testing.
CSS is a list of rules. Each rule selects elements and declares property/value pairs. A linked stylesheet keeps style separate from document meaning and can serve multiple pages. When the browser cannot understand one declaration, it ignores that declaration and continues, so a typo may fail silently. Comments explain intent but do not replace clear names.
An invalid property or missing stylesheet path can make styling disappear without an obvious page error. Inspect the Styles and Network panels before guessing.
Write three rules from scratch: one type selector, one class selector, and one hover state. Deliberately misspell a property, inspect the result, then repair it.
- Rebuild the core idea without copying the example line by line.
- Explain the key HTML or CSS choice in your own words.
- Test the result at a narrow width and with keyboard navigation where relevant.
Open example.html in a browser. Edit style.css, save, and refresh.
Try: Change the notice background and add a border property.