HTML <link rel="stylesheet">
- closing tag
- none — void element
- void element
- yes
- lives inside
- <head>
- typically holds
- n/a (self-contained)
Where it goes
Inside <head>. It needs both rel="stylesheet" and href="path/to/file.css".
Example
<link rel="stylesheet" href="style.css">Open this example in the editor →
Common mistakes
- Writing </link>. There is nothing to close.
- Mixing it up with <a>. <link> never makes anything clickable. It attaches files like stylesheets. <a> is the link people click.
- Getting the path wrong. The browser says nothing. An unstyled page with no error almost always means the href points at nothing.