# Element “link” is missing one or more of the following attributes: “href”, “resource”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/element-link-is-missing-one-or-more-of-the-following-attributes-href-resource
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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

```html
<link rel="stylesheet">
```

The `rel` attribute is present, but there is no `href` telling the browser where to find the stylesheet.

## Valid example

```html
<link rel="stylesheet" href="styles.css">
```

Adding the `href` attribute resolves the validation error.
