Best for · Website builders
Building a website with HTML: the first page, in order
- Last checked
- 3 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- plain HTML if you want a small, fast, free site you fully control: a portfolio, a menu, a one page business card.
- a builder if you want drag and drop, forms and a shop without writing code.
Compared here
- 01Text editor
- 02index.html
- 03Browser
- 04Free host
Short answer
You can build a real website with one text file and a browser. Make a folder, create a file called index.html, paste a short skeleton (doctype, html, head, body), add a heading, a paragraph, an image, a list and a link, and open the file. Mozilla's beginner lesson walks through exactly that, and its page skeleton is only about ten lines.
Pick plain HTML if you want a small, fast, free site you fully control: a portfolio, a menu, a one page business card. Pick a builder if you want drag and drop, forms and a shop without writing code. Below: the exact steps with code, the mistakes beginners make, how to put it online for $0, and when HTML stops being enough. No affiliate money on the steps; one section mentions builders that do pay us.
At a glance
| Step | What you do | Tag or file | Common mistake |
|---|---|---|---|
| 1. Folder and file | Make a folder called first-website, add index.html and an images folder | index.html | Naming the file something else and wondering why the server shows nothing |
| 2. Skeleton | Paste the doctype, html, head and body | <!doctype html>, <html>, <head>, <body> | Forgetting the doctype, or the charset line |
| 3. Image | Add an image with a source and alt text | <img src alt> | Wrong path, or a lazy alt like "My test image" |
| 4. Text | Headings, paragraphs, lists | <h1> to <h6>, <p>, <ul>, <ol>, <li> | Using headings for size, not structure |
| 5. Links | Wrap text in an anchor | <a href> | Leaving off https:// so the link breaks |
| 6. Check | Save, open in a browser, refresh after each change | Browser | Editing the file and never saving it |
Want a website and do not want to pay for one? HTML is the oldest trick in the book, and it still works. This guide follows Mozilla's own beginner lesson (MDN Web Docs), so the steps come from the people who write the reference, not from a random blog. We read the lessons on 4 December 2026. We did not build a site for this page; the code below is quoted or adapted from MDN's examples.
What you need
A text editor and a browser. That is the whole list. Any plain text editor will do; use one that saves plain text, not a word processor. You do not need to install anything, buy anything or sign up for anything.
MDN's lesson has you make a project folder, create a folder called first-website inside it, then a file called index.html and a folder called images with one picture in it. The file name index.html matters, because it is the name web servers load by default for a folder.
Step 1: the skeleton
Put this into index.html, "exactly as shown" in MDN's words:
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My test page</title>
</head>
<body>
<img src="" alt="My test image" />
</body>
</html>
What each part does, using MDN's descriptions:
<!doctype html>is "a required preamble." The Basic syntax page calls it "a historical artifact that needs to be included for everything else to work correctly."<html>"wraps all the content on the entire page and is sometimes known as the root element."<head>is a container for everything you want on the page "that isn't the content you are showing to your page's viewers."<meta charset="utf-8" />sets the character set to UTF-8. MDN says "there is no reason not to set this."<meta name="viewport" content="width=device-width" />makes the page render at the width of the browser viewport, which matters on phones.<title>is the text in the browser tab.<body>"contains all the content that you want to show to web users."
How tags work, in two minutes
An element has an opening tag, content and a closing tag: <p>My cat is very grumpy</p>. The closing tag adds a slash. MDN warns that forgetting a closing tag is a common beginner error that can produce "peculiar results." Tag names are not case sensitive, but lowercase is best practice.
Attributes add information: src, alt, href, class. Always put quotes around the value. MDN's example: title=The Mozilla homepage without quotes is read as title="The" plus two extra attributes called Mozilla and homepage. That is the kind of thing that makes a page behave oddly and costs you an hour.
Nesting must close in reverse order. This is right: <p>My cat is <strong>very</strong> grumpy.</p>. This is wrong: <p>My cat is <strong>very grumpy.</p></strong>, because "the browser has to guess at your intent."
Some elements have no closing tag. These are void elements, like <img> and <br />. The closing slash is optional.
Comments hide text from the page: <!-- this is ignored -->. Handy for notes to yourself.
Step 2: add an image
<img src="images/firefox-icon.png" alt="The Firefox logo: a flaming fox surrounding the Earth" />
src is the path to the image. alt describes it for people using screen readers, or when the image does not load. MDN calls "My test image" a weak alt and gives a better description as the example. Write the alt like you are describing the picture to a friend over the phone. It also helps search engines, which cannot see pictures.
If the image does not show, MDN says to check the syntax, such as quote marks and the file name. Nine times out of ten it is the path or a capital letter.
Step 3: headings and paragraphs
HTML has six heading levels, <h1> to <h6>, but MDN says "you'll commonly only use 3 to 4 at most".
<h1>My main title</h1>
<h2>My top level heading</h2>
<h3>My subheading</h3>
<p>This is a single paragraph</p>
Use one <h1> for the page title and use the other levels to show structure, not to make text bigger. Size is CSS's job. Search engines and screen readers use headings as an outline.
Step 4: lists
MDN says marking up a list "always consists of at least 2 elements": the list and the items.
<ul>
<li>Eat</li>
<li>Sleep</li>
<li>Repeat</li>
</ul>
Use <ul> for lists where order does not matter, <ol> where it does, and <li> for each item.
Step 5: links
<a href="https://www.mozilla.org/en-US/about/manifesto/">Mozilla Manifesto</a>
href stands for hypertext reference. MDN warns: "You might get unexpected results if you omit the https:// or http:// part, called the protocol." For links between your own pages, point to the file, such as about.html. Click every link after you write it.
Step 6: check it
Save the file, then open it in your browser: double click it, or drag it into a tab. Make a change, save, refresh. MDN says to view the result after each step, which is good advice. If something looks wrong, undo your last edit before you hunt for the cause.
MDN also hosts a finished reference version at mdn.github.io/beginner-html-site if you want to compare.
Mistakes that eat a whole evening
- Saving as
index.html.txt. Show file extensions in your system settings. - Mixing single and double quotes around one value. MDN says they are interchangeable but must not be mixed.
- Missing closing tags.
- A missing
langattribute or charset line, which causes odd characters. - Pasting text from a word processor with fancy quotes that are not real quote characters.
Putting it online for free
A static HTML site needs a host that serves files. Our free HTML web hosting guide compares six, with limits from their own pages. Cloudflare Pages is one; its product page is at cloudflare.com/products/pages. Upload the folder with index.html at the top.
You will also want a domain. A free address on the host's own subdomain works while you learn. Our domain name cost guide shows what a real one costs per year. For paid hosting, see how much web hosting costs in our hosting section.
When plain HTML stops being enough
HTML is great for a few pages that rarely change. It gets painful when you need:
- A contact form that sends email.
- A blog you update every week.
- A shop with a cart and payments.
- A team that edits content without touching code.
That is where HTML vs WordPress becomes the real question, and where builders earn their fee. If you want a design tool that outputs real HTML, look at Framer (try Framer) or Webflow (try Webflow). Money talk: both pay us a commission. Neither pays for a place in the steps above, which are MDN's. Compare costs on our Webflow pricing page and the website cost calculator. If you do not want to code at all, free website builder software lists no cost options.
Next steps after the first page
- Add a second page and link between them.
- Learn enough CSS to set fonts, colors and spacing.
- Make the page look right on a phone. The viewport line from step 1 is the start.
- Put it online and check it on your own phone.
Keep each change small, and save and refresh often. The people who stick with HTML are the ones who treat it as a series of tiny wins.
What we checked
We read two MDN Web Docs lessons on 4 December 2026 and quoted them. We did not test the code in every browser, build a full site or time how long it takes a beginner. The hosting options are summarized from our other page, which has its own sources. If a step does not work for you, the MDN lesson is the place to compare against.
Questions people ask
Can I build a website with just HTML?
Yes. A page needs a text file ending in .html and a browser to open it. MDN's lesson builds a first page with a heading, an image, paragraphs, a list and a link, no other tools. It will look plain, because HTML gives structure and CSS gives style. For looks you add CSS later. For forms or shops you need more.
What is the minimum HTML a page needs?
MDN's smallest complete document is the doctype, an html element with a language, a head holding the charset and a title, and a body with content. That is about ten lines. The doctype, the page says, is needed "for everything else to work correctly", and it recommends the short form .
Do I need to know CSS and JavaScript too?
Not for a first page. HTML alone shows text, images, lists and links. CSS controls colors, fonts and layout, and JavaScript adds behavior such as menus. Most real sites use all three. Start with HTML, then add CSS once you can make a clean page, and leave JavaScript until you have a reason.
How do I put an HTML website online for free?
Use a static host. Our free HTML web hosting page compares GitHub Pages, Cloudflare Pages, Netlify, Vercel, Neocities and InfinityFree, with limits read from their own pages. Upload the folder with index.html in it. Check the limits and whether you can attach your own domain before you commit to one.
Why does my image not show up?
MDN says to check the syntax first, such as quote marks and the file name. The src has to point to the right path, for example images/firefox-icon.png for a file inside an images folder. Spelling and capital letters count. The alt text shows if the image fails, so write a useful one.
Is hand coded HTML better than a website builder?
Neither wins everywhere. HTML is free, light and fully yours, but you do the work for everything: layout, mobile, forms, updates. Builders trade some control and a monthly fee for speed. If you only need a few pages and enjoy learning, HTML is fine. If you need a shop or bookings, a builder is less pain.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- MDN Web Docs: Creating your first web page with HTML, checked 4 Dec 2026
- MDN Web Docs: Basic HTML syntax, checked 4 Dec 2026
- Cloudflare Pages, checked 4 Dec 2026