# Element “link” is missing one or more of the following attributes: “itemprop”, “property”, “rel”.

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

The `<link>` element connects your HTML document to external resources like stylesheets, icons, fonts, and prefetched pages. According to the HTML specification, a `<link>` element must include at least one of `rel`, `itemprop`, or `property` so that its purpose is clearly defined. A bare `<link>` with only an `href` is meaningless—it points to a resource but doesn't explain *what that resource is for*. The validator raises this error to enforce that every `<link>` carries semantic meaning.

This matters for several reasons. Browsers rely on these attributes to decide how to handle the linked resource. A `<link>` with `rel="stylesheet"` triggers CSS loading, while `rel="icon"` tells the browser to use the resource as a favicon. Without one of the required attributes, browsers may ignore the element entirely, leading to missing styles, icons, or other resources. It also affects accessibility tools and search engines that parse your markup for structured data.

### Understanding the three attributes

- **`rel`** — The most common attribute. It defines the relationship between your document and the linked resource. Examples include `stylesheet`, `icon`, `preconnect`, `preload`, `canonical`, and `alternate`. Most `<link>` elements in practice use `rel`.

- **`itemprop`** — Used when the `<link>` element is part of an HTML Microdata structure. It specifies a property name within an `itemscope`, linking to a URL as the property's value. This is commonly seen with Schema.org vocabularies.

- **`property`** — Used with RDFa metadata (such as Open Graph tags). It defines a metadata property for the document, like `og:image` or `schema:citation`.

You only need **one** of these three attributes to satisfy the requirement, though you can combine them when appropriate.

## Examples

### Invalid: `<link>` with no relationship attribute

This triggers the validation error because the element has no `rel`, `itemprop`, or `property` attribute:

```html
<head>
  <title>My Page</title>
  <link href="styles.css">
</head>
```

### Fixed: adding `rel` for a stylesheet

```html
<head>
  <title>My Page</title>
  <link rel="stylesheet" href="styles.css">
</head>
```

### Fixed: common uses of `rel`

```html
<head>
  <title>My Page</title>
  <link rel="stylesheet" href="styles.css">
  <link rel="icon" href="favicon.ico">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="canonical" href="https://example.com/page">
</head>
```

### Fixed: using `itemprop` with Microdata

When a `<link>` appears inside an element with `itemscope`, use `itemprop` to define a property that takes a URL value:

```html
<div itemscope itemtype="https://schema.org/Article">
  <h2 itemprop="name">Understanding HTML Validation</h2>
  <link itemprop="mainEntityOfPage" href="https://example.com/article">
</div>
```

### Fixed: using `property` with RDFa / Open Graph

Open Graph meta tags for social sharing commonly use the `property` attribute. While `<meta>` is more typical for Open Graph, `<link>` with `property` is valid for URL-type values:

```html
<head>
  <title>My Page</title>
  <link property="og:image" href="https://example.com/image.jpg">
  <link property="schema:citation" href="https://example.com/source.html">
</head>
```

### Invalid: typo or misplaced attribute

Sometimes this error appears because of a misspelled attribute name:

```html
<head>
  <title>My Page</title>
  <link rел="stylesheet" href="styles.css">
</head>
```

Double-check that `rel` is spelled correctly and isn't accidentally omitted when copying markup from templates or code snippets.

### Quick fix checklist

1. **Linking to a stylesheet, icon, font, or other resource?** Add the appropriate `rel` value.
2. **Defining Microdata properties?** Use `itemprop` within an `itemscope` context.
3. **Adding RDFa or Open Graph metadata?** Use `property` with the correct vocabulary prefix.
4. **Still seeing the error?** Check for typos in the attribute name or ensure the attribute isn't accidentally empty.
