HTML Basics Notes
Introduction to HTML
HTML (HyperText Markup Language) is the standard language used to create and structure
content on the web. It was created by Tim Berners-Lee in 1991 and has evolved through
several versions, with HTML5 being the current standard. HTML uses a system of elements
represented by tags to define the structure and meaning of web content.
HTML is not a programming language; it is a markup language. It describes the structure of a
webpage using a series of elements that tell the browser how to display content. HTML works
alongside CSS (for styling) and JavaScript (for behaviour) to create complete web
experiences. Every website you visit is built on an HTML foundation.
Version Year
HTML 1.0 1991
HTML 4.01 1999
XHTML 1.0 2000
HTML5 2014 (ongoing)
Basic Structure
Every HTML document follows a standard structure. The DOCTYPE html declaration tells the
browser this is an HTML5 document. The html element is the root element that wraps all
content. Inside it, the head section contains meta-information such as the page title, character
encoding, linked stylesheets, and scripts. The body section holds all visible content.
The meta charset='UTF-8' tag ensures proper encoding of special characters. The title tag
sets the text shown in the browser tab and is important for search engine optimisation (SEO).
The link tag inside head is used to attach external CSS files. Proper document structure
ensures cross-browser compatibility and accessibility.
Tag Purpose
DOCTYPE Document type declaration
html Root element
head Metadata container
body Visible page content
Common Tags
Heading tags h1 through h6 define titles and subtitles, with h1 being the most important. The
p tag creates paragraphs of text. Hyperlinks are created with the a href tag. Images are
embedded with the self-closing img src tag; the alt attribute is essential for accessibility and
SEO.
Lists come in two forms: unordered lists (ul) use bullet points, while ordered lists (ol) use
numbers. Both use li tags for individual list items. The div tag is a generic block-level container
useful for grouping elements, while span is its inline equivalent. Semantic HTML5 tags like
header, main, article, section, and footer provide meaningful structure.
Tag Purpose
h1 to h6 Headings
p Paragraph
a Hyperlink
img Image
ul / ol Lists