Making Google Fonts code HTML5 valid

Google Fonts are great for embedding on your website but Google’s code snippets which are provided for you to cut and paste aren’t actually HTML5 valid. This means your lovely code is spoiled by this oversight. Luckily it’s a quick and easy fix and is caused by the ‘pipes’ (|) – also known as straight lines or vertical bars – in the stylesheet URL Google provide. Currently, Google Fonts provide you with code that looks something like this to put in your <head>: Continue reading “Making Google Fonts code HTML5 valid”



Making Google’s reCAPTCHA iframe form HTML 5 valid

Here’s a quick tip on how to make sure Google’s reCAPTCHA form is HTML 5 valid. Basically, the attribute frameborder="0" is no longer is necessary in HTML 5 – here’s W3C Schools opinion. However, Google’s reCAPTCHA example code and recaptchalib.php files are not updated to correct this, as you can see here: Continue reading “Making Google’s reCAPTCHA iframe form HTML 5 valid”



Making YouTube’s embed code XHTML 1.0 Strict

YouTube is great for sharing videos. However, when you want to embed those videos on your own website, it can be difficult to validate the ’embed code’ that they give you, especially when you are using the ‘XHTML 1.0 Strict’ doctype.

Google now gives you the option of ‘iframes’ or the old ’embed’ code. Despite the iframe option being made available for the HTML5 specification, you’ll still find they don’t validate in ‘XHTML 1.0 Strict’! How frustrating.

Well, there is a way of changing the old ’embed’ code to make it compliant. Here is the code to make your YouTube videos validate correctly: Continue reading “Making YouTube’s embed code XHTML 1.0 Strict”