HTML Tutorial

HTML is the standard markup language for creating Web pages.

What is HTML?

HTML stands for Hyper Text Markup Language

HTML is the standard markup language for creating Web pages

HTML describes the structure of a Web page

HTML consists of a series of elements

HTML elements tell the browser how to display the content

HTML Document Example




  Page Title



  

My First Heading

My first paragraph.

Example Explained:

  • The <!DOCTYPE html> declaration defines that this document is an HTML5 document
  • The <html> element is the root element of an HTML page
  • The <head> element contains meta information about the HTML page
  • The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
  • The <body> element defines the document's body and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
  • The <h1> element defines a large heading
  • The <p> element defines a paragraph

HTML Elements

An HTML element usually consists of a start tag, content, and an end tag:

Content goes here...

The HTML element is everything from the start tag to the end tag:

My First Heading

My first paragraph.

HTML Attributes

All HTML elements can have attributes. Attributes provide additional information about elements.

Attributes are always specified in the start tag.

Attributes usually come in name/value pairs like: name="value".

Visit Learn It Quicker

In the example above, the attribute href specifies the URL of the page the link goes to.

HTML Headings

HTML headings are defined with the <h1> to <h6> tags:

This is heading 1

This is heading 2

This is heading 3

This is heading 4

This is heading 5
This is heading 6

HTML Paragraphs

HTML paragraphs are defined with the <p> tag:

This is a paragraph.

This is another paragraph.

HTML Links

HTML links are defined with the <a> tag:

This is a link

The link's destination is specified in the href attribute.

HTML Images

HTML images are defined with the <img> tag:

Image description

The <img> element has two required attributes: src and alt.

HTML Lists

HTML lists come in three types: unordered, ordered, and description lists.

Unordered List:

  • Coffee
  • Tea
  • Milk

Ordered List:

  1. Coffee
  2. Tea
  3. Milk

HTML Tables

HTML tables are defined with the <table> tag:

Firstname Lastname Age
Jill Smith 50
Eve Jackson 94

HTML Forms

HTML forms are used to collect user input:






HTML5 Semantic Elements

HTML5 introduced several semantic elements that define different parts of a web page:

  • <header> - Defines a header for a document or section
  • <nav> - Defines a container for navigation links
  • <section> - Defines a section in a document
  • <article> - Defines an independent, self-contained content
  • <aside> - Defines content aside from the content (like a sidebar)
  • <footer> - Defines a footer for a document or section
  • <details> - Defines additional details that the user can view or hide
  • <summary> - Defines a heading for the <details> element
Open Try It Editor >>