Detecting and Testing HTML 5 Support

 

ATTENTION: THIS PAGE IS Valid HTML 5 AND IS BEST VIEWED WITH HTML 5 - Please upgrade your browser or download one of the HTML 5 compatible browsers such as Mozilla Firefox, Chrome, Opera or IE 9 (March 14, 2011 or later). For more information see HTML 5 browsers.


If you find this helpful, please click the Google +1 Button to the left, if it is white, to make it turn blue or red. Thank you! (It also helps find this page again more easily.)


PDF mobile

Detecting HTML 5 is as easy as 1-2-3

To test support for HTML 5 and display different messages based on whether HTML 5 support is available, try this:

  1. Create a sample web page. Include a paragraph with a message indicating that HTML 5 is not supported. In the starting <p> tag, include a class attribute with "nohtml". See the example below.
  2. Create a style sheet with a template to suppress any HTML tags that have the class="nohtml" attribute. See the style sheet included with the example.
  3. Include a xml-stylesheet instruction that references the style sheet.
Example of Detecting HTML 5 Support

test detection of HTML 5


Valid HTML 5