freecoding.school100% FREE · NO SIGNUP
Cascade FallsISSUE #3 of 33

how to add css · inline · internal · external

StylaVSThe Specificity Sphinx
Styla saysCSS attaches three ways: inline style attributes, an internal <style> block, or an external linked file.

Inline (style="…") styles one element and doesn't scale. An internal <style> block in the head styles one page. An external file linked with <link rel="stylesheet"> styles a whole site and gets cached. External is the standard for real projects; internal suits single-file pages.

Power-ups you unlock

The Specificity Sphinx attacks — common mistakes

Boss battleMove an inline style into the <style> block as a class, then apply that class to the element.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.hi{color:#b388ff;font-size:22px}</style></head><body style="background:#06040d"><p class="hi">styled from an internal block</p></body></html>
▶ Open the interactive comic issue
‹ Syntax · Selector · Declaration · Property · ValueSelectors · Element · Class · Id ›