Mission 1: Applying Styles

A critical alert needs to be red, but the main stylesheet is locked. You must apply a direct, high-priority style override using a class.

00:00

Step 1 / 2

System Briefing: Style Application Methods

Technician, there are three primary protocols for applying CSS to an HTML document. Understanding when to use each is key to writing maintainable and efficient code.

1. Inline CSS

Styles are applied directly to an HTML element using the style attribute. This has the highest specificity but is the hardest to maintain. Use it only for quick, one-off overrides.

2. Internal CSS

Styles are placed inside a <style> tag within the HTML document's <head>. This affects only the current page.

3. External CSS

Styles are defined in a separate .css file and linked in the HTML's <head> with a <link> tag. This is the best practice as it separates content from presentation and allows styles to be reused across many pages.

Editor