In HTML 4 and XHTML 1, you cannot assign a class to an element <head>. However, in XHTML 1.0 you can give it an ID. In HTML5, it seems like you can give it a class. I'm curious why would you like to?
<head>
classis one of what is now called global attributes (along with global events). They will need to be applied to every element in the DOM, regardless of its nature.
class
, API. HTML DOM HTMLElement, . :
HTMLElement
interface HTMLElement : Element { // ... // metadata attributes attribute DOMString id; attribute DOMString title; attribute DOMString lang; attribute DOMString dir; attribute DOMString className; readonly attribute DOMTokenList classList; readonly attribute DOMStringMap dataset;
, /:
. , . , - volumechange , .
volumechange
, , , , . API (.. HTMLHeadElement a HTMLElement ).
HTMLHeadElement