What is HTML?

Learn how to structure your web page and its contents.

HTML Stands for, Hypertext Markup Language. It’s used to structure web pages and their contents.

The basics of HTML

Markup

Key components of HTML markup:

  • Document type declaration, that initiates standards mode rendering.
  • Tags, with attributes.
  • HTML tag – Describes the webpage.
  • head tag – Describes the webpage.
  • title tag – Shows the title of the page on browser tabs.
  • meta tag – Defines the webpage metadata.
  • body tag – Contains the page content.

Elements

HTML elements make up the structure of HTML pages. They are indicated in the HTML document as tags and are used to wrap the content to display them in a certain way.

Example HTML element:


<p>I'm a paragraph!</p>

Parts of an HTML element

An element consists of the following parts:

Opening tag – The name of the element, that’s enclosed in angle brackets.

<p>

Closing tag – The name of the element, that’s enclosed in angle brackets and a forward slash to denote that the element ends.

</p>

Content – The content of the elements. It can also be another HTML element.


I'm a paragraph

(Optional) Attributes – Attributes provide additional information about an element that can also be used to help style or manipulate the element:

Structure of an HTML Document

To help browsers display web pages correctly, every HTML document starts with the document type declaration, <!DOCYTPE html>. Example

<!DOCTYPE html>
 <html>
 <head>
    <meta charset="utf-8">
    <title>My first web page</title>
 </head>
 <body>
    <p>My first web page!<p/>
 </body>
</html>

Other parts of an HTML document:

  • HTML – Otherwise known as the root element, wraps all the content of the web page.
  • head – Holds information in the HTML document not visible to the user. It’s where you put metadata for SEO, scripts, styles, and more.
  • meta charset=”utf-8″ – Declares the character set used in the document.
  • title – Ths is the title of your page that is visible in browser tabs.
  • body – Where the visible content lives.

Learn more about HTML and how to build your own web page.


More from CreationSpacelab