Software Development Resources
Main Page | Software Development | Categories | Recent changes | About DocForge
Log in / create account | Log in with OpenID | Help

HTML

From DocForge

HTML is an abbreviation for HyperText Markup Language, a document format used to define web pages. HTML is characterized by content surrounded by elements (also called tags) which help describe the content. The HTML is typically rendered within a web browser for display to an end user.

Up until HTML5, HTML specifications were versioned. The Web Hypertext Application Technology Working Group (WHATWG) then moved to a new development model where the technology is a "living standard" and evolves continuously.[1]

Contents

[edit] Hello World

A minimalist Hello World example:

<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <p>Hello World!</p>
  </body>
</html>

Every HTML document must contain one top-level html element. Within that, there must be one head element and one body element. The head element must contain one title element. Any other elements within head and body are optional.

[edit] HTML Elements

html
Defines the enclosing content as being HTML. After document type markup, html is the root element which surrounds the entire contents of the page. (Required)

[edit] Head

head
Defines meta data typically not displayed directly within web pages, but useful to web browsers and crawlers. (Required)
base
Indicates the base URL
title
Always within head, defines the title of the page. It's used for display in web browser tabs and title bars. It's also used as a link title by most search engines. (Required)
link
References other related documents, such as CSS, RSS, copyright, and search URLs.
meta
Text-based meta information, such as document description and keywords
script
Defines external scripts or inline code to execute. This element is also available within the document body.

[edit] Body

body
Defines the main content of the web page. The content within the body tag defines what's displayed within the main window of the web browser.
a
Defines an anchor, typically a link to another document, but can also be a name to represent a target within the current document.
abbr
Denotes an abbreviation
address
Contact information.
area
Defines an image-map link to another document.
article
Article content.
aside
Content which is separate from the main article. (Introduced in HTML 5)
bdo
Specifies a direction override of the Unicode BiDi algorithm
blockquote
Defines a quotation block
br
Line break
cite
Title of a cited work
dd
Description, to follow a dt term
del
Deleted text
details
Control for additional on-demand information (Introduced in HTML 5)
dfn
Defining instance
div
Generic block-level element
dl
Description list
li
Line items within an ordered or unordered list (ol or ul)
mark
Highlighted text (Introduced in HTML 5)
meter
A scalar gauge (Introduced in HTML 5)
nav
Grouped navigational elements (Introduced in HTML 5)
ol
Designates an unordered list. The li elements within are typically rendered with numbers on their left.
p
Defines a paragraph.
progress
Progress indicator
ul
Designates an unordered list. The li elements within are typically rendered with bullets, as opposed to an ordered list (ol) which are rendered with numbers.
script
Defines external scripts or inline code to execute.

[edit] Text

b
Bold text
code
Computer code for display (not execution)
i
Italic text
em
Emphasized text
strong
Strong text
span
Generic text-level element - unlike div, does not directly affect formatting

[edit] Tables

caption
Table title (optional)
col
Table column
colgroup
Column group (optional)
table
The root element of a table description
tbody
Table body, containing trs and tds (optional)
th
Table column header, within a thead
thead
Table head, containing ths (optional)
td
"Table data", a single cell within the table
tr
Table row

[edit] Media

audio
Describes an audio stream. (Introduced in HTML 5)
canvas
A graphical canvas which can be updated dynamically. (Introduced in HTML 5)
figcaption
Caption for a figure. (Introduced in HTML 5)
figure
A figure, typically associated with an article. (Introduced in HTML 5)
img
A static image
source
Media source (Introduced in HTML 5)
video
Describes a video stream (Introduced in HTML 5)

[edit] Forms

form
Defines a set of input elements used to submit data to a web server.
button
Defines a button within a form which can be styled. Buttons can be used for submitting the form, resetting the values, or be tied to a JavaScript action.
command
Command with an associated action (Introduced in HTML 5)
datalist
Options defined for other form controls (Introduced in HTML 5)
input
Defines a data input field within a form.
output
Calculation results (Introduced in HTML 5)

[edit] References

  1. The WHATWG Blog - HTML is the new HTML5

Discussion

comments powered by Disqus