Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTML provides a page’s content and semantic structure; CSS controls how that content is presented and arranged. To build a useful HTML layout, put content in a logical order using elements that describe its purpose, then use CSS Grid, Flexbox, and responsive sizing to adapt the design to available space.

What an HTML layout is

An HTML layout is the structure and visual arrangement of a web page. These are related but distinct jobs: HTML describes content and relationships, while CSS determines its appearance, including spacing, columns, alignment, and how elements respond to different viewport sizes.

Start with a document that makes sense in source order, even before styling. A page’s visual design can then be built around that structure without making the meaning of its content depend on its position on screen.

Choose HTML elements for meaning

Use semantic elements to describe the role of each part of the page, not just to create boxes for styling. A typical page might include a <header> for introductory or navigational content, a <nav> for navigation, a <main> for the page’s primary content, an <article> for a self-contained piece, and a <footer> for closing information.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

An <aside> is appropriate for related, secondary content, but a visual sidebar does not automatically need to be an aside. Choose elements according to the content’s meaning and relationship to the rest of the page.

Use headings to show hierarchy

Label sections with headings and nest them according to the page’s actual structure. Headings and meaningful page regions help people understand where they are and move between sections. W3C’s Page Structure Tutorial explains how these practices support navigation and orientation, including for screen-reader and keyboard users.

Choose between CSS Grid and Flexbox

Grid and Flexbox are complementary CSS layout tools, not competing ways to build an entire page. Pick the tool that matches the spatial relationship you need, and combine them when different parts of the page call for different behavior.

Layout tool Best fit Typical behavior
Flexbox A one-dimensional row or column Items can grow, shrink, distribute available space, or wrap within the layout.
Grid Coordinated rows and columns, or placement across two dimensions Elements can be arranged in a shared two-dimensional structure.

For example, Flexbox can arrange items in a navigation bar, while Grid can coordinate a set of page columns. These are practical starting points, not rigid rules; the content and behavior you want should determine the choice. MDN’s guides to CSS Grid and Flexbox explain how both methods support responsive layouts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make the layout adapt to available space

Responsive design lets a layout accommodate the space available instead of assuming every reader has the same screen dimensions. Prefer flexible sizing and content that can reflow over a rigid page width that forces horizontal scrolling on a narrow screen or leaves excessive unused space on a wide one.

Media queries can change the layout when its content no longer fits comfortably, but they are not a requirement for every responsive design. Base the change on the needs of the content rather than targeting a list of specific devices. MDN’s responsive web design guide covers flexible layouts and media queries.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • 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

Keep visual order and reading order aligned

Arrange content in the HTML source in the order people should encounter it. CSS can make elements appear in a different visual order, but that does not change their default reading order for assistive technology or their ordinary keyboard focus sequence. A page that looks correctly ordered on screen may therefore be confusing to someone navigating it with a keyboard or screen reader.

Do not use Flexbox’s order, reversed directions, or Grid placement to repair an incorrect document sequence. Fix the HTML source order when the logical sequence is wrong, then check that keyboard focus follows a sensible path through interactive elements. MDN’s Grid layout and accessibility guide quotes the CSS Grid Layout specification: “Authors must use order and the grid-placement properties only for visual, not logical, reordering of content. Style sheets that use these features to perform logical reordering are non-conforming.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check reflow, zoom, and keyboard navigation

Review the page at narrow widths and with zoom, paying attention to whether content remains readable and usable without scrolling in two directions. Also navigate interactive elements with the keyboard and confirm that focus follows the intended sequence.

W3C’s technique C31 describes using Flexbox to reflow content and includes a test at a 1280-by-1024 CSS-pixel viewport with 400% zoom. This is an example technique and test procedure, not a required implementation recipe or evidence that Flexbox alone guarantees accessibility conformance. W3C notes that techniques are examples; another implementation can satisfy WCAG.

Why page structure matters for accessibility

Meaningful regions, logical headings, and clear relationships between content help people navigate and understand a page. W3C’s Page Structure Tutorial connects these practices to WCAG success criteria including Info and Relationships (1.3.1, Level A), Bypass Blocks (2.4.1, Level A), Headings and Labels (2.4.6, Level AA), and Section Headings (2.4.10, Level AAA). The tutorial is guidance on applying the criteria; it is not itself a substitute for the normative WCAG requirements.

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.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.