Class on HTML tag

Прикольные кошки плавают: a swimming cat fetches a stick.

You can do whatever you like.

"With the use of CSS classes you can have more than one style per HTML..." - clever, innit?


Recently a curious product manager found a piece of code and asked: "Is it HTML5?"

<!DOCTYPE html>
<html class="layout-poster js no-flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths firefox firefox18 windows wf-active" style="">


Well-paid engineers had got nothing prudent to do during their looooong boooooring days. So they begun apply styles to web pages by another cool way. Despite it works and doesn't blow up the planet Earth, this is not a W3C valid code though.

More about a class attribute in the HTML5 tag

When we find a bunch of classes in the HTML tag, what does it mean, is it HTML5? Yes, this is a sign of HTML5 mentality...

The original idea behind putting classes in a HTML tag was for user-built custom stylesheets in content management frameworks like Wordpress.

HTML class Attribute - In HTML5, the class attribute can be used on any HTML element, it will validate on any HTML element. However, it is not necessarily useful.

Jonas Persson says - I’m a fan of body.isloading { cursor: progress; }


Web development - classes in HTML tag, true HTML5., 71-75 Shelton Street, Covent Garden, London WC2H 9JQ