Quick answer
To learn HTML, install a code editor such as VS Code, create an index.html file, and learn in this order: document structure, headings and paragraphs, links and images, semantic layout tags (header, nav, main, footer), lists and tables, forms, then accessibility and SEO basics. Practise by building small pages, and add CSS once you are comfortable. Most beginners learn the HTML basics in one to two weeks.
Key takeaways
- HTML gives a page its structure; CSS styles it; JavaScript makes it interactive.
- Use semantic tags (header, nav, main, article, footer) instead of div everywhere.
- Every image needs meaningful alt text; every form field needs a label.
- One H1 per page and a logical heading order help both SEO and screen readers.
- Learn by building: a profile page, a restaurant menu and a contact form are great first projects.
HTML (HyperText Markup Language) is the foundation of every website. It tells the browser what each part of a page is: a heading, a paragraph, a link, an image, a form. It is the first thing every web developer learns, and also useful for marketers, bloggers and business owners who edit their own websites. Follow these eight steps in order.
Step 1: Set up your tools
- Install a free editor: Visual Studio Code.
- Use Chrome, Edge or Firefox and learn to open DevTools (right-click → Inspect).
- Create a folder called
my-siteand a file inside it calledindex.html.
Step 2: Learn the basic page structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My first page</title>
<meta name="description" content="A short description for search results.">
</head>
<body>
<h1>Hello, world</h1>
<p>This is my first web page.</p>
</body>
</html>Open the file in your browser to see it. The head holds information about the page; the body holds what visitors see.
Step 3: Text, links and images
<h2>About me</h2>
<p>I build <strong>fast</strong> websites in <em>Mumbai</em>.</p>
<a href="https://example.com">Visit my portfolio</a>
<img src="photo.webp" alt="Tamir presenting at a workshop" width="600" height="400">Use headings h1 to h6 in order, with one h1 per page. Always add alt text that describes the image, plus width and height to avoid layout shifts.
Step 4: Semantic layout elements
<header>
<nav><a href="/">Home</a> <a href="/services/">Services</a></nav>
</header>
<main>
<article>
<h1>How to choose a web designer</h1>
<section><h2>Check their portfolio</h2><p>...</p></section>
</article>
<aside>Related links</aside>
</main>
<footer>© 2026 My Company</footer>Semantic tags tell browsers, screen readers and search engines what each area is for, which helps accessibility and SEO.
Step 5: Lists and tables
<ul><li>SEO</li><li>Google Ads</li></ul>
<ol><li>Plan</li><li>Build</li><li>Launch</li></ol>
<table>
<caption>Website packages</caption>
<thead><tr><th>Plan</th><th>Pages</th></tr></thead>
<tbody><tr><td>Starter</td><td>5</td></tr></tbody>
</table>Use tables only for tabular data, never for page layout.
Need a website that turns visitors into enquiries?
My team builds fast, secure, SEO-ready websites and web apps for growing businesses.
Step 6: Forms
<form action="/contact" method="post">
<label for="name">Name</label>
<input id="name" name="name" required autocomplete="name">
<label for="phone">Phone</label>
<input id="phone" name="phone" type="tel" required autocomplete="tel">
<label for="msg">What do you need?</label>
<textarea id="msg" name="message"></textarea>
<button type="submit">Send enquiry</button>
</form>Input types like email, tel and number show the right keyboard on phones. Labels make fields clickable and readable by screen readers.
Step 7: Accessibility and SEO basics
- Set
langon thehtmltag. - Write a unique
titleandmeta descriptionfor every page. - Use descriptive link text (“download the price list”, not “click here”).
- Make sure everything works with the keyboard alone.
- Check your page with the Lighthouse panel in Chrome DevTools.
Step 8: Add CSS and build real projects
Once your HTML is solid, learn CSS for layout and design, then JavaScript. Practice projects:
- A personal profile page with a photo, bio and links.
- A restaurant menu using lists and a table.
- A business landing page with a contact form.
- A three-page site linked together with a shared header and footer.
Next steps: how to become a front end developer.
Where can I learn HTML for free?
- MDN Web Docs (Mozilla): the most accurate reference.
- freeCodeCamp: free interactive Responsive Web Design course.
- W3Schools: quick examples and a try-it editor.
- web.dev by Google: courses on HTML, accessibility and performance.
Frequently asked questions
How long does it take to learn HTML?
Most beginners learn the core HTML elements in one to two weeks of regular practice. Becoming fluent with semantic structure, forms and accessibility takes a little longer, alongside CSS.
Is HTML a programming language?
No. HTML is a markup language: it describes the structure and meaning of content. Programming logic comes from languages such as JavaScript or PHP.
Can I learn HTML on my phone?
You can read and practise basics with mobile code editors, but a laptop with VS Code and a browser is much better for real learning and projects.
Should I learn HTML and CSS together?
Learn HTML first for a few days, then start CSS alongside it. You will use them together on every project.