You design a web page in HTML by creating a single .html file, describing the page's structure with headings, paragraphs, lists, links, and media, wiring that content to a stylesheet for visual design, and opening the file in a browser to check it. The key condition is that HTML supplies meaning and structure, while CSS supplies appearance—keep those jobs separate and the page will be easier to build, read on phones, and maintain later. This tutorial walks through the whole process in order, from prerequisites and your first file to layout, testing, and a short list of failures worth knowing about. It sticks to standard HTML and CSS that current browsers support, with no frameworks required.
What you need before writing a line of markup
You need four things: a plain-text editor (Notepad on Windows, TextEdit in plain-text mode on macOS, or an editor like Visual Studio Code), a modern browser such as Chrome, Firefox, Safari, or Edge, a folder on your computer to hold the project, and enough patience to type tags correctly. That's it. You don't need a server, a hosting account, or any paid software to build and preview a page.
Set up the folder first. Create a directory—say, my-site—and plan to keep everything inside it: the HTML file, an images subfolder, and a CSS file. Relative file paths only work when files stay in the same folder structure, so tidiness now prevents broken images later. If you use a code editor, save the folder as a workspace or project so you can see all files at once.
One more piece of preparation: decide, in a sentence, what the page is for. "A personal page about my photography hobby" or "a one-page site for my bicycle repair side business." A clear purpose tells you which sections the HTML actually needs—headline, a few paragraphs, maybe a list of services, a contact link—and keeps you from stuffing in elements you don't need.
The smallest real HTML page, explained line by line
Every page starts with the same skeleton. Type this into your editor and save it as index.html inside your project folder:
Here's what each piece does. tells the browser to use modern standards mode; leaving it out can trigger quirky legacy rendering. The element wraps everything and declares the page language, which helps screen readers and translation tools—change en if your content is in another language. Inside , the charset meta tag ensures accented characters and symbols display correctly, and the viewport tag is what makes the page size itself to a phone screen instead of shrinking a desktop-width page down to unreadable text. The is what shows in the browser tab and in search results, so give it something specific. The holds everything a visitor actually sees.
Open the file in your browser—double-click it, or use the browser's File > Open command. You should see the heading and paragraph. Success check: the tab shows "My First Page," and the text appears in the browser's default font at the top-left. If you see raw code instead, the file was probably saved with a .txt extension; rename it so it ends in .html.
Structuring content with headings, paragraphs, lists, and links
Design in HTML begins with deciding what each chunk of content is. Headings come in six levels, through . Use one per page for the main topic, then for major sections and for subsections. Don't pick heading levels by the size you want—browsers style smaller than by default, but sizing is CSS's job. Pick by outline logic, because screen readers and search engines use that outline to understand the page.
Paragraphs go in tags, and each paragraph should hold one idea. Lists come in two flavors: for unordered (bulleted) lists where order doesn't matter, and for ordered lists where it does, such as steps in a recipe. Each item inside either is an . Definition-style content—term and explanation pairs—can use with and , though that's optional for most beginners.
Links use the anchor element, visible text. The href attribute holds the destination. Link text should describe where the link goes—"see the pricing page" beats "click here"—because link text is what screen reader users hear when they tab through links. For a link to another page in your own project, use a relative path like href="about.html". If you later add a link that opens in a new tab with target="_blank", add rel="noopener" alongside it; that's a small security hygiene habit worth forming early.
Emphasis works through for importance and for stress emphasis. Browsers render these bold and italic by default, but their real value is meaning. And if you need to group a chunk of content that shares a theme—a card, a sidebar block—reach for ; if the grouping is a distinct, self-contained piece like a blog post or comment, is the better fit.
A quick semantic example of a page body:
That structure alone already reads clearly in a browser, with zero CSS. That's the point: HTML should make sense before styling arrives.
Building the page skeleton: header, navigation, main, footer, and sections
Real pages need landmarks—regions visitors and assistive technology can jump between. The standard page skeleton looks like this:
The logic:
holds introductory material and typically the site title and nav. marks a set of navigation links (not every group of links, but major navigation). wraps the page's unique primary content and should appear once per page. groups thematically related content and, as a rule, each section should have a heading. holds closing material—copyright, contact info, secondary links.
Why bother with these instead of
everywhere? Because landmarks map to how people actually navigate. A screen reader user can pull up a list of regions and jump straight to , skipping the nav on every page. Search engines and browser reading modes also use these to identify the primary content. The practical test: if you stripped away all CSS, would the page's regions still be obvious from the markup? With this skeleton, yes.
For self-contained items that repeat—a product card, a testimonial—use
. For tangential material like related links or an author bio, is available, though plenty of good pages never need it.
Adding images, alternative text, and other media
Images use A blue commuter bicycle leaning against a brick wall. The src is the file path; the alt attribute is the text substitute. Write alt text that conveys the image's purpose in context—a descriptive sentence for informative images, and alt="" (empty, but present) for purely decorative images so screen readers skip them. Don't start alt text with "image of" or "picture of"; the element already implies that. Also avoid stuffing keywords into alt; it's for people, not ranking games.
You don't have to specify width or height in HTML—CSS can handle sizing. But if you do set dimensions and later want images to scale down on phones, a CSS rule like img { max-width: 100%; height: auto; } will keep them from overflowing their container. Forgetting that rule is one of the most common causes of sideways-scrolling mobile pages.
Other media: a short video can be embedded with —the controls attribute gives viewers play and pause buttons. Audio works the same way with . If you embed a YouTube or similar player, most providers give you an