Adding CSS to HTML
A self-closing HTML element placed in <head> that connects an external CSS file. Its rel attribute must be "stylesheet" and href provides the file path.
What it does: Linking one external file from many pages means a single change updates every page at once. <link rel="stylesheet" href="file.css"> in the <head> loads an external CSS file. <css> is not a valid HTML element. <link> and <style> both belong in the <head>. Placing them in <body> is invalid and may cause rendering issues. Inline styles (style="...") override external and embedded styles because they have the highest specificity. rel="stylesheet" is required to tell the browser the linked file is a CSS stylesheet. Without it, the file is ignored. The style attribute accepts CSS property-value pairs directly on any element, such as <p style="color:red;">.
Common mistakes: HTML tag names must be lowercase. <Style> should be written as <style>. The href attribute value must be in double quotes: href="styles.css", not href=styles.css without quotes.
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
<link>Fill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →