mm

January 19, 2015 WATB Team
Follow me on Twitter

A little bit of research on our competitors, based on searching Google for “Surrey Web Design” reveals that almost all of our competitor websites fail W3C Validation. Some of them fail spectacularly, generating 50+ errors with their HTML.

Our website doesn’t validate either, but when it comes to validation, it’s important to know how to interpret the results. Invalid code is not always incorrect, and the validator is not always accurate. For example, WATB fails validation fails because we are using a new spec of HTML image tag which the validator has not been updated yet to support.

This involves specifying a “srcset” attribute on the img tag, but not a “src” attribute. Specifying a “src” attribute makes the code valid, but means the browser will download the image twice.

Pushing the boundaries with front-end and using new features early will indeed, as in this example, cause your code to fail validation. But so long as you are following the spec and the code works, you can take this with a pinch of salt and choose to ignore it.

Where you should not ignore validation is with basic errors and any errors in your syntax that can easily be avoided, and are not due to using a new spec that the validator doesn’t recognise yet. For example, many of the competitor websites we put through the validator, failed because of stray end tags or missing elements.

Every front-end coder should thoroughly test and validate their code, so there are really no excuses for these kind of errors. They’re important too, mistakes in your syntax can cause the page to break in some browsers. Clean, valid code is also a sign of a coder who takes pride in their work and has given the project the necessary time, mistakes are usually down to rushing.

At WATB, we always validate our code and take the time to iron out any avoidable errors. However, where we are using a new spec or a feature that the validator doesn’t yet recognise, this can still cause our code to fail the validator. We’re just that cutting edge…

Looking for more tips?

Jump on our mailing list & get digital goodness straight to your inbox; including helpful tips, tricks and the latest articles surrounding marketing, web design and branding.

Sign up →