6 June 2020

Checking the validity of the site code

The quality of the finished site largely depends on small details and therefore, for example, considerable attention is paid to the compliance of the layout of the site code with certain standards. And if you consider that search engines evaluate the correct layout of the site as one of the rather important ranking factors, it becomes clear that such a procedure as checking the validity of the code is not a luxury, but a necessity for any site.

Modern browsers are good at “smoothing out” minor typesetting errors and therefore can display sites correctly for users even if the site code is invalid somewhere, that is, not in accordance with generally accepted standards. However, this does not mean that possible errors or inaccuracies in the code can be taken carelessly: sooner or later they can still lead to problems when, for example, in one of the old browsers, visitors see an incorrect layout on the site or when the site will take too long to load.

Checking the code for validity is a great way to prevent possible problems in the site. Such verification can be done manually, or it can be done online, using the appropriate services. Manual verification takes a lot of time and is very tiring, but online verification of the site code validity is just what you need. At the same time, it is most convenient to check the site code for validity using the free online service from the World Wide Web Consortium, W3C, an organization that, in fact, has developed technological standards for the Internet.

The W3C was founded by Sir Timothy John Bernes-Lee, known as the inventor of URI, URL, HTTP, HTML, and the World Wide Web itself. Today, W3C is developing common principles and standards for the Internet, which ensures high compatibility between the products of completely unrelated companies, and the World Wide Web eventually becomes more universal and convenient.

The list of standards approved by W3C includes, in particular, HTML and CSS, and therefore it is not surprising that it makes sense to check the validity of the corresponding site codes using the online toolkit proposed by W3C. Using W3C online validators is easy. For example, to check the validity of HTML, you must use the Markup Validation Service (validator.w3.org). In this service, a check is available for site pages already published on the Internet, for files from a local PC, or for code directly inserted into the validator window.

When checking with the W3C validator, you can get a report that indicates whether errors are detected. At the same time, for errors, the validator will indicate the exact location of them, and also offer the correct syntax. It should be noted that if the validator detects not gross errors, but inaccuracies in the code being verified, then it will display warnings in the report to the user.

Markup Validation Service from W3C allows you to check the validity of HTML and XHTML, but if you need to check the validity of the CSS code of the site, then in this case W3C offers its CSS Validation Service (jigsaw.w3.org/css-validator). Validation in this service is carried out similarly to the verification of HTML code: a link to the site’s page being checked or a CSS file is inserted into the validator field, after which the service displays the errors or inaccuracies found. As in the Markup Validation Service, when checking CSS, you can download the code under investigation from a PC or paste the code directly into the validator window.

Checking the site for validity has recently become particularly relevant, because at the end of 2014 it is planned to finalize HTML5 in the status of the W3C recommendation, which entails the need to make some changes to the usual layout of sites. For example, some tags and attributes supported in HTML4 are considered obsolete in HTML5 and the standard does not recommend using them for layout. In particular, the tags obsolete in HTML5 include the font and center tags, which were previously actively used to format texts for layout.