Alex M. Alex M. - 1 month ago 16
HTML Question

Markup Validation, Errors found

I've tried recently to validate a web page and every time I run the validator it outputs the same errors, although the structure of the page seems legit.

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
...


It should be something wrong with the source but I can't figure it out..
link to markup validation results

Answer

Based on looking at the actual errors the document contains, a few recommendations:

Use the current W3C HTML Checker at https://validator.w3.org/nu/

Check your document with https://validator.w3.org/nu/ not https://validator.w3.org/.

https://validator.w3.org/ is written in Perl and uses SGML and DTDs to perform validation and so is very limited in the kinds of checks it can do (e.g., it can’t do precise datatype/microsyntax checking of attribute values. And if your document uses a modern doctype (<!DOCTYPE html>, the “HTML5” doctype declaration), it just hands the doc of to https://validator.w3.org/nu/ for checking anyway.

https://validator.w3.org/nu/ checks your document against the current HTML spec (aka HTML5), and includes many types of checks which https://validator.w3.org/ cannot do.

Checking https://validator.w3.org/nu/?doc=http://demo.amiron.eu/equilibrium/ brings up two points:

Always start your documents with <!DOCTYPE html>

The document at http://demo.amiron.eu/equilibrium/ currently doesn’t have any document type declaration at all. That’s an outright error, because the lack of a doctype can cause unexpected behavior in browsers. And if you use any doctype other than <!DOCTYPE HTML> it is also easier to get part of the doctype wrong in a way that cause unexpected behavior in browsers.

Always include <meta charset="utf-8"> in your documents

The character encoding for http://demo.amiron.eu/equilibrium/ is not declared in the HTTP headers that the document is served with nor in the document itself. Documents on the Web should be encoded in UTF-8 and to be certain their encoding is always made clear to browsers and other tools, documents should always include a <meta charset="utf-8"> element.