Designing a web page in HTML starts with separating three layers: HTML for meaning and structure, CSS for visual design, and a small amount of JavaScript only when behavior is needed. Write the content first as plain, semantic HTML, then add styling, then test at multiple screen widths. The example below builds a complete one-page site—header, hero, card grid, and footer—so you can see each layer in a working order rather than as isolated tags.

This guide assumes you can create and save a text file and open it in a browser. No framework, build tool, or server is required: the example runs from a local folder. Everything shown is stable, version-independent HTML, CSS, and JavaScript that has worked in browsers for years, so you can reproduce it without installing anything.

What "designing in HTML" actually means

A common beginner error is trying to control appearance with HTML alone—wrapping everything in

tags and inserting line breaks to push things around. That approach collapses the moment the screen size changes. The durable model is:

HTML describes structure and meaning. A heading is a heading, a list is a list, a navigation block is a navigation block. Browsers, search engines, and screen readers all rely on this. CSS describes presentation. Colors, spacing, type, columns, and responsive behavior belong here. JavaScript describes behavior. Menus that toggle, form validation, and interactive widgets.

Designing "in HTML" therefore means designing the document skeleton carefully, then attaching a stylesheet. The skeleton determines whether the page is accessible, whether it reflows sensibly on a phone, and how easy it is to restyle later. The visual design is layered on top.

Prerequisites and the example you will build

Before writing markup, settle four things:

1: A purpose statement. One sentence: who the page is for and what they should do. Example: "A landing page for a neighborhood bicycle repair shop that lets visitors see services and find the shop's hours." 2: A content outline. List the sections in reading order. For the example: site header with name and navigation, hero introduction, three service cards, hours and contact details, footer. 3: A folder structure. One folder containing index.html, a styles.css file, and an images subfolder. Keeping files separate from the start avoids painful refactoring later. 4: A browser and a way to view source. Any current browser; you will use its developer tools to inspect layout and catch errors.

That outline is the actual design work. The tags are mostly mechanical once the outline exists.

Step 1: Write the document skeleton

Every HTML page begins with the same small set of declarations. Create index.html and start with this:

Why each line matters:

puts the browser in standards mode. Without it, some layout rules behave inconsistently. lang="en" tells assistive technology and translation tools the page language. charset="utf-8" ensures curly quotes, dashes, and non-Latin characters render correctly. The viewport meta tag is what makes a phone render the page at device width instead of pretending to be a desktop screen. Omitting it is the single most common cause of "why is everything tiny on my phone." The is the text in the browser tab and the clickable headline in search results. Make it specific: business or page name plus purpose, not "Home." The description meta tag is a summary search engines may show. Write it for a human reader.

Save the file and open it in a browser. You should see a blank page with the correct tab title. That is your first success check: if the title is wrong, the file path or filename is wrong.

Step 2: Add semantic structure in reading order

Semantic elements are ordinary boxes with meaning attached. The main ones you will use constantly are header, nav, main, section, article, aside, and footer. They behave like div visually but tell software what each region is. A screen reader user can jump straight to main, skipping repeated navigation.

Here is the full skeleton for the example, still without styling:

A few decisions worth noticing:

One h1 per page, describing the page's main topic. Then h2 for major sections and h3 inside cards. Do not skip levels to get a smaller font; adjust size with CSS. Navigation links point to IDs (#services) on the sections. Browsers scroll to the matching id automatically, which gives you a working in-page menu with zero JavaScript. The price is inside a paragraph with a class, not a styled soup. Styling hooks are classes, and the content stays readable in plain text. Phone and email are tel: and mailto: links, so mobile users can tap to call or compose.

At this point the page is fully functional and readable with no CSS. That is the correct intermediate state: structure first, presentation second. If you stop here, the page still works for every user, including those with slow connections or screen readers.

Step 3: Build the layout and visual design in CSS

Create styles.css in the same folder. The following set of rules produces a clean, responsive layout. Read the comments; they explain the mechanism, not just the value.

Refresh the page. You should see a bordered header with the brand and inline navigation, a large hero headline, three cards in a row on a wide window, and a muted footer.

Key mechanisms, briefly:

box-sizing: border-box makes padding and borders count inside an element's declared width. Without it, a card with padding overflows its grid column, a classic beginner bug. Flexbox on the header spaces the brand and navigation apart and lets them wrap to two rows instead of overflowing when the window narrows. grid-template-columns: 1fr followed by a media query at 40rem (640px at default text size) switches the cards from one column to three. This is the essence of responsive design: one layout, a breakpoint where it improves, no separate mobile page. clamp() on the hero heading scales the font size between a minimum and maximum based on viewport width—fluid type without JavaScript. max-width plus margin: 0 auto is the standard centered-column pattern, easier and more robust than fixed widths.

Check your work by resizing the browser from very narrow to very wide. The header should stay readable, the cards should stack then spread, and no element should cross the edge of the window. If something overflows horizontally, suspect a fixed width or padding without border-box.

Step 4: Add small, optional behavior

The in-page navigation already works from Step 2. Only add JavaScript when a genuine interaction need appears. A realistic one for this page: highlighting the navigation link for the section currently on screen. That is a convenience, not a requirement, so the page must stay usable if the script fails.

If you want to try it, this snippet goes just before :

Add a matching rule to your stylesheet (.site-header nav a.active { text-decoration: underline; }). Test it by scrolling: the underline should move from "Services" to "Hours" to "Contact." If the underline moves in the wrong direction, check that the section IDs in the HTML match the link hrefs exactly; a typo on either side silently breaks the connection.

Failure cases you will hit, and how to diagnose them

Beginners usually stumble on the same handful of problems. Each has a quick, reversible check:

The page is blank or partially styled. Open the browser's developer tools (usually F12 or right-click → Inspect). Look at the Console tab for errors and the Network tab for a failed styles.css request. If the CSS file does not appear in the Network list at all, the href path is wrong—most often a typo or a missing file in the same folder.

A link does not jump to its section. The section needs an id attribute and the link needs href="#that-same-string". IDs are case-sensitive and must be unique on the page.

The navigation menu looks like a bulleted list. The list-style: none plus margin: 0; padding: 0 rules are missing or the selector doesn't match your markup. Inspect the element to confirm which selector is actually applying.

A horizontal scrollbar appears at phone width. Some element is wider than the viewport—commonly a fixed width, a large image, or padding added to a 100%-width element without border-box. Inspect the widest element and remove the fixed width.

Text is unreadably small on a phone. The viewport meta tag from Step 1 is absent or malformed. This is worth checking first because it affects the entire page.

The page looks fine on your screen but cramped on another. That is expected and is why you test at multiple widths. Add a breakpoint where the layout genuinely improves; do not chase every individual device.

A practical stop condition: if a failure involves server behavior—404s from a deployed site that works locally, HTTPS errors, or hosting configuration—you have left static HTML territory. At that point, the fix depends on the hosting environment and needs someone with access to that environment rather than more tag editing.

Design principles that keep the example maintainable

Once a page works, these practices determine whether it survives the third round of edits.

Keep one source of truth for each value. Define colors, spacing, and font sizes once. CSS custom properties are ideal: :root { --brand: #0b6b3a; --text: #222; } and then color: var(--text);. When the shop rebrands, you change one line instead of hunting through forty rules.

Name classes by role, not appearance. .card and .button describe what the element is. .red-box describes what it looks like today and becomes a lie the moment you restyle. Role names are easier to restyle and easier for teammates to read.

Design for real content. This example is short enough to be a placeholder. Real pages have long product names, prices with decimals, and text that runs to three lines. Test with a few long strings in your content: if the card layout breaks when a heading wraps to two lines, fix the layout, not the copy.

Start from accessible defaults. Semantic elements, headings in order, visible focus outlines (do not remove outline on links without a clearly better replacement), sufficient color contrast, and descriptive link text ("View services," not "Click here"). These are cheap at design time and expensive to retrofit.

Separate the layers in the file system. Three files—index.html, styles.css, and eventually app.js—keep each layer readable. Inline