HTML Guide
In HTML5, there’s no need to specify the version
attribute - it is now obsolete. Here’s an example minimal HTML document to start with:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
</head>
<body>
<p></p>
</body>
</html>
Learn more:
Related W3C validator issues
Instead of using the isolang attribute to define the language of the document, you can use lang with an ISO 639-1 two character code.
For example, for Portuguese:
<html lang="pt">
The “HTTP resource not retrievable” error with an HTTP status code of 404 indicates that the W3C Validator could not find a specific web page by its URL. This error occurs when the URL provided for a page is incorrect, or the page no longer exists at the given address.
The “HTTP resource not retrievable” error with an HTTP status code of 503 indicates that the W3C Validator could not access a web page referenced in your HTML. This error occurs when the remote server hosting the page is temporarily unavailable or overloaded.
Rocket Validator checks HTML on your sites using the latest version of W3C Validator Nu HTML Checker, which is intended for HTML5 documents.
The page scanned is using an obsolete doctype, instead of the expected <!DOCTYPE html>.
A stray start tag <html> has been found in the document. As this tag defines the start of the whole HTML document, it should appear only once.
The old <acronym> element in previous versions is now obsolete, in HTML5 you must use <abbr> instead.
The <big> tag is now obsolete. It was used to increase the size of text, you can do that using CSS instead. For example:
<p>Now this is <span style="font-size: larger;">big</span></p>
The W3C Validator is indicating that the charset attribute on the link element is obsolete. According to modern HTML standards, the charset attribute should not be used on the <link> element, and instead, the character encoding should be specified via an HTTP Content-Type header on the server response of the resource.
Here’s how you can address and fix the issue:
1. Remove the charset attribute from the <link> element:
You should simply remove the charset attribute from the <link> element in your HTML file.
Before:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css" charset="UTF-8">
<title>Example Page</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
After:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<title>Example Page</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
2. Set the charset using HTTP Headers:
To ensure that the correct character encoding is used, you should configure your web server to send the appropriate Content-Type header with the CSS file.
-
For Apache: You can modify the .htaccess file or the server configuration file.
<FilesMatch "\.css$"> AddCharset UTF-8 .css </FilesMatch>
-
For Nginx: You can add the following directive to your server block or location block:
location ~* \.css$ { charset utf-8; }
-
For Express.js (Node.js): You can set headers in your response:
app.get('/styles.css', function(req, res) { res.setHeader('Content-Type', 'text/css; charset=UTF-8'); res.sendFile(__dirname + '/styles.css'); });
A <script> element has been found that is using the now obsolete charset attribute. You can safely remove this attribute.
For example, this is using both type and charset attributes, with their default values. Both can be removed:
<script src="app.js" type="text/javascript" charset="UTF-8"></script>
and just use this:
<script src="app.js"></script>
The <font> element, used to define the font face, size and color in previous versions of HTML, is no longer valid in HTML5. Instead, you should rely on CSS styles.
For example, you can define a font size of 12px, bold text with inline styles like this:
<p style="font-size: 12px; font-weight: bold;">some text</p>