You create a website with HTML by writing structured markup that names each piece of content (headings, paragraphs, images, links, forms), then styling that structure with CSS and adding behavior with JavaScript. HTML alone gives you a working but plain page; design happens when HTML and CSS are planned together. This guide covers the full sequence for a hand-coded site: planning, file setup, semantic structure, visual design, responsiveness, testing, and publishing. Everything here uses stable, long-established language features and browser behavior, so it applies regardless of which editor or host you pick. The exact tools change; the method doesn't.

Plan the site before writing a single tag

HTML is a description of content, so the content has to exist first, at least on paper. Decide the site's purpose and its audience, then list the pages that purpose requires. A small business brochure site might need Home, About, Services, and Contact. A personal portfolio might need Home, Work, About, and a contact method. A documentation site lives or dies by its navigation, so sketch the page hierarchy before anything else.

Next, inventory the content per page. For each page, write down the actual headings, the paragraphs in rough form, the images you'll need, and the links that matter. This step prevents the common beginner failure of building a beautiful shell and then discovering there's nothing to put in it.

Finally, decide on a file and folder structure. A flat folder with every file at the top level becomes unmanageable fast. Use a structure like this:

The file named index.html is the default page a web server returns for a directory, so your home page must carry that name. Lowercase file names with hyphens instead of spaces avoid case-sensitivity problems; many servers treat About.html and about.html as different files, and links that work on your laptop may break once uploaded.

Success check: before coding, you can describe every page in one sentence and point to its file name in the structure above.

Set up your tools and a local preview loop

You need three things: a text editor, a browser, and a way to view the files you write.

A plain text editor is sufficient. Code editors add syntax highlighting and auto-completion, which reduce typos, but nothing about HTML requires them. A browser is your rendering engine and your debugging tool. The third piece is the preview loop: save the file, refresh the browser, look at the result.

The reliable method is to open the HTML file directly from disk in the browser (double-click it, or drag it into a browser window). The address bar will show a file:// path. That works for most pages, but it has limits: some features that fetch data, such as loading local JSON files, are blocked for security under file://, and absolute paths like /css/styles.css won't resolve. For a static site with relative paths only, direct file opening is fine.

If you hit those limits, run a local server. Python, which is commonly installed on macOS and Linux and available for Windows, includes one: run python3 -m http.server 8000 from your project folder and open . Node.js users have similar one-line options through packages such as http-server. Either way, the address becomes and absolute paths work as they will on a real host.

Failure check: if your CSS doesn't appear, open the browser's developer tools, look at the Network or Console panel for a 404 on the stylesheet, and compare the path in your tag with the actual folder structure. A 404 on a stylesheet almost always means a path typo, not a broken file.

Write the HTML skeleton and get the head right

Every page starts from the same minimal document. Here is a complete valid skeleton:

Each head element earns its place. puts the browser in standards mode, which prevents a set of legacy quirks. The lang attribute on declares the document language, which screen readers use to choose pronunciation. The charset declaration should appear early in the head so the browser knows the encoding before it reads text. The viewport meta tag tells mobile browsers to render at device width rather than shrinking a desktop layout, and omitting it is the single most common cause of "my site looks tiny on phones."

The is what appears in the browser tab, in bookmarks, and as the clickable headline in search results. Write one per page that describes that page specifically; a site where every tab says "Home" is a site that's hard to navigate by tab and hard to distinguish in search. The description meta tag doesn't affect ranking directly in the major search engines, but it often becomes the snippet shown under the title, so write it as a real summary.

Success check: the page loads with no visible content missing, the tab shows your title, and developer tools show no errors.

Build semantic structure that carries meaning

HTML's job is to say what each piece of content is, not how it should look. A heading is a heading because it labels a section, not because it's bold. Choosing elements by meaning, called semantic HTML, buys you three things: accessibility for screen readers and keyboard users, predictable behavior from browsers (links are focusable, buttons respond to Enter and Space), and search engines that can parse your page's hierarchy.

The core elements you'll use constantly:

, , , , and mark page regions. should appear once per page and wrap the primary content. marks a set of navigation links; if a page has more than one nav region, label each with aria-label.

through are headings in rank order. Use exactly one

per page, matching the page's main topic, and don't skip levels for visual reasons. If a subsection needs to look smaller, style it; don't demote the tag.

is a paragraph. and are unordered and ordered lists; items belong inside them. is a link to another resource. is a control that does something on the page. Using a styled link as a button, or a clickable , breaks keyboard and screen-reader behavior. with pairs an image with its caption. requires an alt attribute; write meaningful text for informative images and alt="" for purely decorative ones. , , , , and build inputs. Every input needs a associated by for/id or by wrapping the input, which both enlarges the click target and gives screen readers the field name. A realistic main section looks like this: Notice that the structure alone communicates the page's outline. Someone reading only the headings and list items gets the full picture. That's the test of good semantic markup. Failure check: remove the CSS entirely. If the page still reads in a logical order and the headings form a sensible outline, your structure is sound. If it collapses into an undifferentiated wall of text, the structure is doing too little and the styling is doing too much. Design the visual layer with CSS Design in HTML means separating structure from presentation and letting CSS handle the look. There are three ways to attach CSS, and they differ in scope: inline style attributes affect one element, a