About This HTML Issue
A <link> element must have either an href or a resource attribute. Without one of these, the browser has no way to know what the element points to.
The <link> element defines a relationship between the current document and an external resource. The href attribute specifies the URL of that resource. When href is missing, the element is incomplete and has no effect.
A common cause is forgetting to add the href when writing a <link> for a stylesheet, icon, or preload directive. Another cause is accidentally leaving a <link> tag in the markup after removing its URL during editing.
The resource attribute is far less common and appears in RDFa contexts. For most HTML documents, href is the attribute you want.
Invalid example
<link rel="stylesheet">
The rel attribute is present, but there is no href telling the browser where to find the stylesheet.
Valid example
<link rel="stylesheet" href="styles.css">
Adding the href attribute resolves the validation error.
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.
Help us improve our guides
Was this guide helpful?
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries