diffsnack
HTML Head Find the mistake

Loading CSS

The design of a page usually lives in a separate CSS file. A <link> in the head connects that file to the page.

Step by step

  1. <link> connects the page to another file.
  2. href says where the CSS file is.
  3. rel="stylesheet" says the file is the page design.
  4. Without the right rel, the browser does not apply the file.
The card, bug marked
1<link rel="preload" as="image"
2 href="images/live.webp"
3 fetchpriority="high">
4<link href="css/landing.css"
5 rel="style">
This is how it's right
<head>
<link href="css/landing.css"
rel="stylesheet">
</head>

Exercises for this topic

Key rule

A CSS file only works with rel="stylesheet".

Where you'll meet this

Every styled website has at least one of these lines in the head. If a page suddenly looks plain, check the href and the rel.

Play this card Next article: Names for screen readers