Create your first web page by saving a small HTML document as index.html and opening it in a browser. HTML gives content structure and meaning; CSS controls how it looks, and JavaScript adds interactive behavior. This tutorial walks through a working first page, explains each part, and shows how to preview and troubleshoot it.
What you need to make your first web page
You can build this exercise with a text editor and a web browser. You do not need a design program or a web server to view a basic HTML file on your own computer. If creating a local file is inconvenient, you can experiment in a browser-based editor such as CodePen or JSFiddle; MDN’s first-website guide describes both approaches.
Keep the first page small. Choose a subject you know—such as a hobby, a pet, a favorite recipe, or a project—and write a title, a short paragraph, and a few grouped details. Starting with a simple page makes it easier to understand how the code maps to what you see.
Understand the basic HTML document
HTML (HyperText Markup Language) structures web content. As MDN explains, it is the most basic building block of the Web. Most HTML content is marked up with elements: tags indicate the boundaries of an element, while attributes provide additional information about it.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Here is a complete first page. Copy it into a plain-text editor, then change the sample subject and content to your own.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>About my garden</title>
</head>
<body>
<h1>About my garden</h1>
<p>I grow a few useful plants in a sunny corner.</p>
<h2>What I grow</h2>
<ul>
<li>Tomatoes</li>
<li>Basil</li>
</ul>
<p><a href="https://example.com">Visit a sample website</a></p>
</body>
</html>
The document declaration and root
<!doctype html> tells the browser to treat the file as modern HTML. The <html> element is the root of the document: the other page elements sit inside it. Its lang="en" attribute identifies English as the page’s primary language. If your page is primarily in another language, use the appropriate language code.
The head: information about the page
The <head> contains information for the browser rather than the page’s main visible content. The character-encoding declaration <meta charset="utf-8"> supports text in a broad range of writing systems. The viewport declaration helps the page render at the device’s browser width, which matters on phones as well as desktop screens.
The text inside <title> is the document title. It is not the same as the visible main heading: it identifies the page in browser contexts such as the tab. Give it a short, useful name.
Recommended Free Tools
The body: visible content
Put the content readers should see inside <body>. In this example, <h1> introduces the page’s main topic, <p> marks prose, <h2> introduces a subsection, and <ul> with its <li> elements represents a list.
Most elements have an opening tag and a closing tag. For example, <p>Some text</p> wraps a paragraph. Nest elements inside their parent elements and close them in the right order. Some elements, including <meta>, do not wrap content and have no separate closing tag.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Add useful content with headings, lists, links, and images
Use headings to show the content hierarchy
Use one clear main heading for the page, then use lower-level headings for sections beneath it. A heading is not just a way to make text appear larger: it tells browsers and assistive technologies how your content is organized. Choose the heading level that reflects the structure, not the appearance you want.
Choose paragraphs or lists to fit the information
Use a paragraph for a passage of prose. Use an unordered list, marked up with <ul>, when the order of the items does not matter. For steps or another sequence where order matters, use <ol>. Put each list item in its own <li> element.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Make links describe their destination
A link uses an <a> element and an href attribute containing its destination. For example, <a href="https://example.com">Visit a sample website</a> creates a clickable link. Write link text that gives a reader a useful idea of where it goes, rather than relying on a vague phrase such as “click here.”
Add an image with a meaningful alternative
Use an <img> element when an image helps communicate something on the page. Its src attribute points to the image file or address, and its alt attribute supplies a text alternative. For a local image stored in an images folder beside your HTML file, you could write:
<img src="images/tomatoes.jpg" alt="Ripe tomatoes growing on a vine" />
Replace that path and description with the image you actually use. Write alternative text that conveys the image’s relevant information; do not leave src empty or use an unrelated description. If an image is purely decorative and adds no information, consider whether it belongs in the page at all before adding it.
Save the file and preview it in a browser
-
In your text editor, choose its option to create a new plain-text file. Paste in the example HTML and edit the title and page content.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Save the file in a folder you can find again, using the exact name
index.html. Check that the editor has not added a second extension such as.txt. -
Open the saved file in a web browser. You can usually do this by double-clicking the file in your file manager or using the browser’s Open File command.
-
When you change the code, save the file and reload the browser tab to see the updated page.
If you would rather try the markup without managing local files, use a browser-based editor such as CodePen or JSFiddle. These are useful for quick experiments; a local folder is a more direct way to keep a project’s files together on your device.
What HTML can—and cannot—do by itself
HTML supplies structure and meaning; it does not by itself provide a polished visual design. CSS controls presentation and layout, such as colors, spacing, and how content is arranged. JavaScript adds behavior and interactivity. You can begin with HTML alone, then add CSS once your content and its structure make sense.
That sequence is useful because styling cannot fix unclear content structure. First make the page readable and organized with the appropriate HTML elements; then use CSS to change its visual presentation. MDN’s guide to structuring content with HTML and its first-website guide provide further learning paths.
Rank #4
Troubleshoot common first-page problems
-
The browser displays code instead of a page. Confirm that the file ends in
.html, not.txt, and that it was saved as plain text. Open the correct file in the browser. -
Your latest changes do not appear. Save the file in the editor, then reload the browser tab. Also check that you edited the same file you opened.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
An image is missing. Check that the
srcpath matches the file’s actual name and location. A path likeimages/tomatoes.jpgexpects animagesfolder next to the HTML file and a file namedtomatoes.jpginside it. -
A link does not go where expected. Check the spelling and punctuation in the
hrefvalue, including the URL scheme such ashttps://. -
Text or sections look wrong. Check that each opening tag has the intended closing tag and that nested elements close in the reverse order in which they opened. Make sure visible page content is inside
<body>. -
Headings look out of order. Review the page outline and use heading levels to reflect parent and child sections. Do not choose a heading level just to change text size; CSS is the tool for visual styling.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Best Value
Or skip the browser setup
If your goal is to capture a web page rather than learn HTML, ScreenshotNeo can return a screenshot or PDF with one GET request. It is a website screenshot API and MCP server for developers, made by Yorker Media. The browser-based workflow above is still the right choice for learning how to write your own page; the API is an alternative for capturing pages that already exist online.
For an API key and options, see the ScreenshotNeo documentation. This cURL example captures a page as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to AI agents using Claude, Cursor, or another MCP client. The Free plan includes 1,000 shots per month with no card required; paid plans start at $5 for 3,000 shots. Every feature is available on every plan.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently Asked Questions
Can I make a web page with HTML without installing special software?
Yes. A plain-text editor and a browser are enough to create and preview a basic local HTML file.
What should I learn after HTML?
Learn CSS for visual styling and layout. JavaScript is the next step when you want to add interactive behavior.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




