Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class attribute in <HTML> tag?

Tags:

html

Is class a legal attribute of the HTML element?

<html class="...">

My Oracle ADF application does this — why?

like image 960
hogni89 Avatar asked May 21 '12 08:05

hogni89


People also ask

What is a class attribute?

Class attributes are variables of a class that are shared between all of its instances. They differ from instance attributes in that instance attributes are owned by one specific instance of the class only, and ​are not shared between instances.

Can I put class on HTML tag?

Class in html:The class attribute can be used on any HTML element. The class name can be used by CSS and JavaScript to perform certain tasks for elements with the specified class name.

What is class HTML?

The HTML class attribute is used to specify a single or multiple class names for an HTML element. The class name can be used by CSS and JavaScript to do some tasks for HTML elements.

What are the 3 types of attribute in HTML?

HTML attributes are generally classified as required attributes, optional attributes, standard attributes, and event attributes: Usually the required and optional attributes modify specific HTML elements.


1 Answers

It is not valid in HTML 4:

<!ENTITY % html.content "HEAD, BODY">

<!ELEMENT HTML O O (%html.content;)    -- document root element -->
<!ATTLIST HTML
  %i18n;                               -- lang, dir --
  >

It is not valid in XHTML 1.0:

<!ELEMENT html (head, body)>
<!ATTLIST html
  %i18n;
  id          ID             #IMPLIED
  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
  >

It is valid in HTML 5:

The following attributes are common to and may be specified on all HTML elements (even those not defined in this specification):

  • ...
  • class
  • ...

My Oracle ADF application does this - wounder why

Presumably to apply style or JS from a shared external file to specific pages.

like image 51
Quentin Avatar answered Sep 27 '22 20:09

Quentin