Best Practices for Fixing Invalid HTML Doctype Errors with Labrika

Invalid HTML DOCTYPE

The DOCTYPE tag means “document type declaration”. It tells web browsers which version of HTML your page is using. You must always prefix your HTML code with the DOCTYPE in the first line of code on the page. By doing this your HTML page will then be compliant with the DOCTYPE selected.

Although modern browsers don't take minor errors in HTML code into account, incorrect DOCTYPE is a more serious problem, as it can affect the availability of your page's content. The 'invalid HTML DOCTYPE' report in Labrika's dashboard allows you to view any pages with these types of errors.

Report Content

The report in Labrika's dashboard will show you a list of URLs where the DOCTYPE is written incorrectly in the code or the sign “No matches found for your query” if there is no a mistake.

Using the report

Once the URLs with incorrect DOCTYPE are identified you can then enter them correctly.

The syntax should be as follows:

<!DOCTYPE [Top-level Element] [Publicity] "[Registration]//[Organization]//[Type] [Name]//[Language]" "[URL]">

What each of these parameters mean:

There are several types of DOCTYPE; they differ depending on the version of the HyperText Markup Language used on the page.

An Example for HTML Version 4.01:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

The HTML5 specification can be written more simply as:

<!DOCTYPE html>