Rocket Validator automatically checks your pages on the W3C Validator.
HTML issues tagged as link.
<link> element has been found in an invalid body context. Check the attributes of the
<link> element and ensure it’s not within the
If the element is within the
<head> section, it may have been interpreted as a
body context depending on previous elements. For example, while this
<link> element is valid per se and is in the
<head> section, it is deemed invalid because the previous
<img> element made the validator consider it a
<!DOCTYPE html> <html lang=""> <head> <title>Test</title> <img src="photo.jpg" alt="A smiling cat" /> <link rel="canonical" href="https://example.com/" /> </head> <body> <p>Some content</p> </body> </html>
If we fix that document and move the
<img> tag within the body, the issue raised about
<meta> disappears because it’s now in a valid context:
<!DOCTYPE html> <html lang=""> <head> <title>Test</title> <link rel="canonical" href="https://example.com/" /> </head> <body> <p>Some content</p> <img src="photo.jpg" alt="A smiling cat" /> </body> </html>
<link> element that is using the
preload value in the
rel attribute is missing the
as attribute, used to indicate the type of the resource.
preload value of the
rel attribute lets you declare fetch requests in the HTML’s
<head>, specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers’ main rendering machinery kicks in. This ensures they are available earlier and are less likely to block the page’s render, improving performance.
as attribute specifies the type of content being loaded by the
<link>, which is necessary for request matching, application of correct content security policy, and setting of correct
Accept request header.
href attribute on the
link element must not be empty.
href attribute on an element
<link> contains a character that is not allowed, and should be encoded.
Some typical examples include the pipe character
| that should be replaced by its encoded alternative
%7C , and the left square bracket
[ that needs to be encoded as
media attribute on a
<link> element has not been recognized.
This attribute specified what media the linked resource is optimized for. As an example, the following will link a general stylesheet, and a specific one for printing:
<head> <link rel="stylesheet" type="text/css" href="general.css"> <link rel="stylesheet" type="text/css" href="print.css" media="print"> </head>
Valid values for this attribute include:
all. Default, used for all media.
screen. Used for computer, tablets or smartphone screens.
The value used to define the
type of a
link is not valid. You’re probably using a URL instead of a valid type.
Example of a valid
<link rel="icon" type="image/png" href="favicon.png">
Still checking your large sites one page at a time?
Save time using our automated web checker. Let our crawler check your web pages on the W3C Validator.