You can create a basic website with HTML by making a folder, adding an index.html file, writing page content with HTML elements, and opening the file in a browser. HTML supplies the structure; CSS adds visual styling. Previewing the file locally lets you work on it before you choose how to publish it online.
What you need to make your first HTML website
For a first static page, you need a place to save a file and a web browser to preview it. You do not need hosting or a domain just to write and view the page on your own computer. MDN’s first-website guide is designed for readers new to web technologies and covers building and publishing a simple site.
Start with a narrow goal, such as a personal profile, a page about a hobby, or a simple landing page. A small first page makes it easier to focus on how HTML elements fit together.
Create an HTML page and preview it
- Make a project folder. Create a folder somewhere easy to find, such as
my-first-site. - Create the home-page file. Inside that folder, create a plain-text file named
index.html. This is the conventional filename for a basic website’s home page. Make sure your editor has not added an extra extension such as.txt. - Add the page structure and content. Use elements for the page title, headings, paragraphs, links, and lists. The example below is a complete starting page; replace the sample text and link with your own.
- Save and open it in a browser. Open
index.htmlfrom your file manager, or use your browser’s open-file command and select it. The browser renders the local file, so you can check your changes without publishing it. - Edit, save, and refresh. After changing the HTML, save the file and reload the browser tab to see the updated page.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My First Website</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first website, built with HTML.</p>
<h2>What I enjoy</h2>
<ul>
<li>Learning how websites work</li>
<li>Making things to share</li>
</ul>
<p>Visit <a href="https://developer.mozilla.org/">MDN Web Docs</a> to keep learning.</p>
</body>
</html>
What the main parts do
<!doctype html>tells the browser to use modern HTML rendering.<html lang="en">wraps the document and identifies its language.<head>holds document information such as the character encoding, viewport setting, and browser-tab title.<body>contains the content visitors see on the page.<h1>,<h2>,<p>,<ul>, and<a>mark up a main heading, a section heading, a paragraph, a list, and a link.
HTML describes the content and its structure. It does not by itself provide a full visual design, application logic, data storage, payment handling, or a backend.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Add CSS for appearance
CSS is the language used to style and lay out a page. It can control colors, fonts, spacing, and columns; it complements HTML rather than replacing it. For a quick first experiment, add a <style> block inside <head>, before </head>:
<style>
body {
max-width: 42rem;
margin: 2rem auto;
padding: 0 1rem;
font-family: sans-serif;
line-height: 1.6;
}
h1 {
color: #174a7e;
}
</style>
Save the file and refresh the browser to see the style. As the page grows, you can move the CSS into a separate file and link it from the HTML. MDN explains the distinction between page structure and presentation in its first-website material.
Rank #2
Check the page before publishing
A browser preview is a local check, not a public website. Before sharing the page, review the rendered result and confirm that the text, headings, and links appear as intended.
- If the page displays the HTML tags as text, confirm the filename ends in
.htmland that you opened the saved file in a browser. - If an edit does not appear, save the file and reload the tab. Check that you edited the same
index.htmlthat the browser opened. - If a link does not work, inspect its
hrefvalue and make sure it contains the intended address.
Publish the HTML website online
Publishing means making the site files available from a web server so other people can visit them. A domain is the public web address; hosting is where the files are served from. Neither is required for writing your first page locally.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
MDN describes more than one route to publishing, including repository-based publishing and buying hosting and a domain for more control. Choose based on how much setup and control you want, whether you need a custom domain, and the host’s current limits and costs. The available evidence does not establish current prices or terms for specific providers, so check the provider’s documentation before choosing. See MDN’s guide to publishing your website for an introduction to the options.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you need a screenshot of a webpage rather than a site built from scratch, ScreenshotNeo takes a screenshot or PDF from one API request. For example, save a WebP screenshot of a page with cURL:
Quick Recap
Best Value
Rank #4
- 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
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for setup and options. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.
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.
Recommended Free Tools




