Knowledgebase

Document Structure and the Essential Elements Print

  • webdevelopment, guide, howto, solution, zillionkinghost, hosting, support
  • 0

The skeleton of a page.

WHAT EVERY DOCUMENT NEEDS

A declaration of the document type A root element, with the language declared A head, containing information about the document A body, containing what is displayed

WHY DECLARE THE LANGUAGE

Screen readers use it to pronounce content correctly, and translation tools use it to identify the source.

WHAT BELONGS IN THE HEAD

The character encoding The title The viewport setting Descriptions and metadata Links to stylesheets

WHY THE ENCODING FIRST

It must be declared early, or the browser may begin interpreting bytes incorrectly.

WHAT TO ALWAYS USE

The international standard encoding, which covers every writing system.

WHAT THE TITLE DOES

Names the document in the browser, in bookmarks and in search results.

WHAT THE VIEWPORT SETTING DOES

Tells mobile browsers to use the device width rather than pretending to be a desktop.

WHAT HAPPENS WITHOUT IT

The page renders as a shrunken desktop layout, unreadable on a phone.

WHAT TO CHECK IN EVERY DOCUMENT

That all four of those are present and correct.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot