You are here: Reference > HTML > tags > html

html element

Browser support:
Identifies an HTML or XHTML document.
The html element is the container element of the body and head tags.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
JavaScript page for this element: html.

Possible members:

Attributes
Events
Styles
Pseudos
accessKey
Sets an access key to an element.
class
Sets the style class or classes that belong to the element.
contentEditable
3
Sets whether the contents of the object are editable.
dir
Sets the text direction as related to the lang attribute.
DISABLED
Sets the state of an object for user interaction.
draggable
3.55
Sets whether an element is draggable.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
language
Sets the scripting language for the current element. Use it only for the script element.
name
Sets the name of an element.
spellcheck
Sets whether the automatic spellchecker is enabled.
style
Sets an inline style associated with an element.
tabIndex
Specifies the tabbing order for keyboard navigation using the TAB key.
title
Specifies a tooltip for an element.
version
Specifies which HTML DTD version governs the current document.
xml:lang
Sets the language code of the XML document.
xmlns
Declares a namespace for custom tags.

Example HTML code 1:

This example illustrates the use of the html element:
<html>
    <head>
        <title>My HomePage</title>
    </head>
    <body>
        The contents of the HTML document.
    </body>
</html>
Did you find this example helpful? yes no

Example HTML code 2:

This example uses the overflow style property of the html element to hide the scrollbars of the document in all browsers:
<head>
    <style>
        html {
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div style="width:1000px; height:1000px; background-color:#a0c0a0;">
        Resize the window, the scrollbars won't be visible.
    </div>
</body>
Did you find this example helpful? yes no

Example HTML code 3:

This example shows how to force the document's scrollbars to be always visible:
<head>
    <style>
        html {
            overflow: scroll;
        }
    </style>
</head>
<body>
    <div style="background-color:#a0c0a0;">
        Resize the window, the scrollbars will be always visible.
    </div>
</body>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content