Fandom

HTML & CSS Wiki

Html

648pages on
this wiki
Add New Page
Comments0 Share

This article is about <html>, the root element of any HTML document. For other uses, see HTML (disambiguation).



The <html> element contains the entire structure of any HTML document, and its first child must be a <head> element, followed by a <body> element. See the tutorial for an introduction to making HTML documents.

Example code Edit

<!DOCTYPE html>
<html>
 <head>
     <title>The title</title>
      [other head content]
  </head>
  <body>
      [body content]
  </body>
</html>

Attributes Edit

Rendering Edit

On most user agents, the <html> element has no visual appearance apart from being a container for the <body> element.

Typical CSS representation:

html {
    display: block;
}

Typical webmail clients remove the <html> element when displaying an HTML-formatted email.

Coding rules Edit

The <html> element is the root element of a document, or the root of a subdocument. It can only contain one <head> element followed by one <body> element.

Both the start and end tags are optional. The <html> element is automatically generated when the tags are not used.

HTML5 requires the start tag if the element's first child is a comment, and requires the end tag is the element is followed by a comment.[1] For example:

<!doctype html>
<html>
  <!-- the html start tag is required because of this comment -->
  ...
</html>
<!-- the html end tag is required because of this comment -->

References Edit

  1. http://dev.w3.org/html5/spec/Overview.html#optional-tags

External linksEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.