HTML (Hyper Text Markup Language) is a language to describe human-readable documents on the internet.

Hypertext is text containing hyperlinks to documents or other parts of documents. Links can refer to either local or remote targets.

What is a markup language

A markup language is used to define the logical structure of a document, how it should be displayed and instructions for programs that process it.

The name originates from the publishing industry, there are many markup languages.

The structure of HTML

A HTML is a tree which consists of elements, each element contains content which may include text and other nested elements.

Elements may contain attributes and point to other resources such as images, scripts, etc

Tags

Elements are defined by tags

Attributes

Attributes are a collection of key-value pairs.

The head element contains document metadata, it is the first part of the document parsed by the browser

  • A document’s title is defined by the title element
  • Meta elements contain other items of metadata
  • Link elements define relationships with other elements
  • Style elements contain CSS styles
  • Script elements contain Javascript code

Body elements

Block level

Block level elements are content that should be rendered separately from other elements such as headings and paragraphs

Inline Level

Inline level elements define elements that should flow together, such as hyperlinks and images

Escape Characters

  • &lt' - less than - <
  • &gt; - greater than - >
  • &amp; - ampersand - &
  • &apos; - apostrophe/single quote - '
  • &quot; - double quote - "
  • &nbsp; - non-breaking space

Useful Inline Elements

  • b makes text bold
  • i idiomatic text (italics)
  • em emphasis (also typically italics)
  • strong more boldening
  • q short quotation
  • code duh
  • span logical unit of content

Self-explanatory, note that target can be set to _self or _blank or other targets

The URL can point to anything, absolute URLs include the full location including the protocl, host and path wheras relative URLs only include the path and are interpreted with relative to the location of the current document

Tables

  • thead
  • tbody
  • tr
    • th
    • td
  • tfoot
  • caption

Comments

<!-- -->