HTML - Document

About

An HTML document 1) is a well-formed HTML string (ie that contains the html root element).

As from one document with Javascript, you can show different text, a web page is a logical representation of a document

Storage

The HTML textual representation can be stored:

When the browser process this page, it will create an in-memory/code representation and the HTML page becomes a DOM document.

Address

The URL associated with a Document is the document's address.

Semantics

Elements represent things; that is, they have intrinsic meaning, also known as semantics. For example, an img element represents an image.

Structure

<!-- tells the browser what language it's reading -->
<!DOCTYPE html>
<!-- Starts the HTML document -->
<html>
 <head>
  <title>Sample page</title>
 </head>
 <body>
  <h1>Sample page</h1>
  <p>This is a <a href="demo.html">simple</a> sample.</p>
  <!-- this is a comment -->
 </body>
<!-- Ends the HTML document -->
</html>

There are always two parts to the file:

  • the head: The head includes metadata information about the web page, such as its title.
  • and the body. The content in the body is what will be visible on the actual page.

HTML vs XML

See DOM - HTML vs XML document

Rendering

To display a page, a browser:

  • fetches the HTML document over the network (generally with a Http get request)
  • parses the HTML,
  • and then converts it into a code / in-memory representation called a DOM document: (Document Object Model: A tree of nodes)

This is described in details in this page: Web - Timeline of a page load (Page Speed|Page Latency)

Type

See Metadata

Id

The identifier of a HTML document is its URL.

But because you may render or move a HTML page to another URL, the rel=canonical was introduced to represent an universal id (as described in RFC 6596).

And to complicate things, all metadata schema may also have their own meta where to store this information. For instance, og:url for the open graph tag

Move

On Facebook, If you move a page to a new URL, you can use the old URL as the canonical source for the new URL, retaining likes, comments and shares for the object. Ref Ref2 - How do I move a page to a different URL?

Html document inside Html document

Note that a html document can contain other document with the frame, iframe.





Discover More
HTML - Browsing context (Environment)

A browsing context is a navigational context (environment) in which HTML document are rendered to the user. Each browsing context has: its own variable its own cookie its own dom and eventually...
Html Heading Sequentiel Order
HTML - Heading Content (Section Header) - Heading Elements (H1 to H6)

Heading define the structure / outline / table of content of the document (page) They are defined via: the heading element (h1/h6) via the aria heading role section of the document letter, the...
HTML - The link element (inter-document relationships)

The link represents metadata that expresses inter-document relationships. hyperlink The link element can be used only within the head element. where: media is a list of media query separated...
How to store and use data in HTML

This article shows where you can store and use data
Resources - Static Resources

Static resources are resources that don't need to be generated. They are file found in a local file system served by a web http server as the body of a response. The type of file returns is given by...
The Document Object Model W3C API Interface (DOM)

W3CAPI The domDocument Object Model (DOM) is one of the two programming models used to represent a XML document. DOM defines the interface description of a Document Object that represents an XML document...
Cors Flowchart
What is Cross Origin Resource Sharing (CORS) ?

What is Cross Origin Resource Sharing (CORS) ? Cross-origin resource sharing (CORS) is a mechanism that: allows a HTTP server to control the cross-origin requests executed by a browser. In short,...



Share this page:
Follow us:
Task Runner