Log in

Generate a basic HTML structure

Choose your page options: the full HTML5 code updates live. Copy it or download the index.html file, then open it in your editor to write your content.

Everything happens in your browser: nothing is sent to or stored on Gromonde.

Page options

In the <head>
Accessibility and extras

index.html

Preview

The preview does not run scripts or load your CSS and JavaScript files: it shows the structure.

Guide: the basic structure of an HTML page

Every web page follows the same skeleton. Starting from a clean structure avoids display bugs on mobile, helps search engines understand the page and makes it accessible to people who use a screen reader.

1. <!DOCTYPE html>

The first line tells the browser to use modern HTML5. Without it, the browser switches to “quirks mode” and imitates the bugs of very old browsers.

2. <html lang="…">

The lang attribute gives the language of the page. Screen readers use it to choose the right pronunciation, browsers to offer translation and search engines to show the page to the right audience.

3. The <head>

It contains information about the page, not visible content: the character encoding (UTF-8, so that accents display correctly), the viewport (without it, phones display a tiny desktop version), the title, the description, the favicon and the CSS files. Put the charset first: it must appear in the first 1024 bytes of the file.

4. Semantic tags

<header>, <nav>, <main>, <article>, <aside> and <footer> describe the role of each area. They look like <div> tags, but they let browsers, search engines and assistive technologies find the menu, the main content and the footer. Use a single <main> and a single <h1> per page.

5. Scripts at the right place

A <script> in the <head> blocks the display of the page while it downloads. With the defer attribute, the script downloads in parallel and runs once the HTML is ready: the page appears faster.

6. Accessibility

The “Skip to content” link lets keyboard users jump directly to the main content without going through the whole menu. Also remember to give every image an alt text and to keep a logical heading order (h1, then h2, then h3).

Next steps

Download the index.html file, create the css and js folders next to it, then open it in a code editor (VS Code, Sublime Text, Notepad++…). To check your code, use the W3C validator (validator.w3.org).

Other free tools