HTML stands for HyperText Markup Language. It's not a programming language — it's a markup language, meaning it doesn't perform logic or calculations. Instead, it structures content on a webpage, telling the browser what's a heading, what's a paragraph, what's a link, and so on.
Every website you've ever visited is built with HTML at its core. It's the very first step into web development — without it, there's no webpage to style with CSS or make interactive with JavaScript. It's also genuinely easy to start with, since you can see results instantly just by opening a file in a browser.
<h1> or <p>This page covers the core fundamentals of HTML, step by step.
Every HTML page follows the same basic skeleton. Here's the simplest possible HTML page:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
<!DOCTYPE html> — tells the browser this is an HTML5 document<html> — wraps the entire page content<head> — holds info about the page (like the title), not shown directly on the page itself<title> — sets the text shown in the browser tab<body> — holds everything visible on the page — text, images, buttons, etc.<tag> and a closing tag </tag>Headings and paragraphs are the most basic building blocks for text content on a webpage.
HTML has six levels of headings, from <h1> (biggest,
most important) to <h6> (smallest). They're used to
organize content, similar to chapter titles and subtitles in a book.
<h1>Main Title</h1>
<h2>Section Heading</h2>
<h3>Subsection Heading</h3>
Regular text content goes inside a <p> tag. Browsers
automatically add spacing above and below paragraphs.
<p>This is a paragraph of text. It can be as long as you want.</p>
Headings should be used in order (don't skip from <h1>
straight to <h4>) — this keeps your page organized
and is important for accessibility, since screen readers rely on
heading structure to help users navigate a page.
HTML links are used to connect one webpage to another webpage, website, file, or section of the same page.
Links are what make the web a "web".
In HTML, links are created using the <a> tag
(short for "anchor").
<a href="https://example.com">Visit Example</a>
The href attribute holds the URL the link points to.
The text between the opening and closing tags is what's clickable.
<a href="about.html">About Us</a>
If the file is in the same folder, you can just use its filename instead of a full web address.
<a href="https://example.com" target="_blank">Visit Example</a>
target="_blank" tells the browser to open the link in a
new tab instead of navigating away from the current page.
<a href="mailto:someone@example.com">Email Us</a>
This opens the user's default email app with the address already filled in.
<a href="#section2">Go to Section 2</a>
<h2 id="section2">Section 2</h2>
A link starting with # jumps to an element on the same
page that has a matching id.
Images are added using the <img> tag. Unlike most
tags, it doesn't need a closing tag — it's self-closing, since it
doesn't wrap around any content.
<img src="photo.jpg">
The src attribute tells the browser which file to load —
this can be a file in your own project folder, or a full web address.
<img src="photo.jpg" alt="A sunset over the ocean">
alt provides a text description of the image. It shows
up if the image fails to load, and it's also read aloud by screen
readers — making your page more accessible.
<img src="photo.jpg" alt="A sunset" width="300" height="200">
width and height set the image's size in
pixels. It's usually better to control sizing with CSS instead, but
these attributes work fine for quick adjustments.
<a href="https://example.com">
<img src="photo.jpg" alt="Click me">
</a>
Wrapping an <img> inside an <a>
tag makes the whole image clickable.
<img> is self-closing — no separate closing tag neededalt text for accessibilitysrc points to the correct location of the image fileHTML has two main types of lists: ordered (numbered) and unordered (bulleted). Both are made up of individual list items.
Use <ul> for a bulleted list, with each item
wrapped in <li>.
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Oranges</li>
</ul>
Use <ol> for a numbered list. The browser
automatically numbers each item for you.
<ol>
<li>Preheat the oven</li>
<li>Mix the ingredients</li>
<li>Bake for 20 minutes</li>
</ol>
Lists can be placed inside other list items, useful for showing sub-categories or steps within steps.
<ul>
<li>Fruits
<ul>
<li>Apples</li>
<li>Bananas</li>
</ul>
</li>
<li>Vegetables</li>
</ul>
<ul> — unordered (bulleted) list<ol> — ordered (numbered) list<li> — each individual item, used inside either typeForms are used to collect input from users — like text, choices, or file uploads — usually to send that data somewhere for processing.
<form>
<label>Name:</label>
<input type="text" name="name">
<input type="submit" value="Send">
</form>
<input type="text"> <!-- single line of text -->
<input type="email"> <!-- email address -->
<input type="password"> <!-- hides typed characters -->
<input type="checkbox"> <!-- yes/no option -->
<input type="radio"> <!-- pick one from a group -->
<input type="submit"> <!-- button to send the form -->
A <label> describes what an input field is for.
Connecting a label to its input with matching for and
id attributes makes forms more accessible — clicking the
label also focuses the input.
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<textarea>Write a longer message here...</textarea>
<select>
<option>Option 1</option>
<option>Option 2</option>
</select>
<label> for accessibilityname attribute identifies each field's data when the form is submittedTables are used to display data in rows and columns — useful for things like schedules, price lists, or any structured data.
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Akshay</td>
<td>21</td>
</tr>
</table>
<table> — wraps the entire table<tr> — table row<th> — table header cell (bold, centered by default)<td> — table data cell (regular content)<table>
<tr>
<th>Subject</th>
<th>Grade</th>
</tr>
<tr>
<td>Math</td>
<td>A</td>
</tr>
<tr>
<td>Science</td>
<td>B</td>
</tr>
</table>
<tr><th>, data cells use <td>Think you've got HTML down? Test yourself!
Start Quiz →