HTML Elements

Structure a document with semantic tags.

HTML
<main>
  <h1>Hello, world</h1>
  <p>My first page.</p>
</main>

Explanation

Elements mark up content according to meaning. Use headings in order, paragraphs for text, and links for navigation.

Explore the dry run
Guided walkthroughReady
1<main>
2 <h1>Hello, world</h1>
3 <p>My first page.</p>
4</main>

Follow the example

Start to inspect the source, values, and output. These prepared steps explain the published sample; grouped loop steps describe multiple iterations.

View the complete dry-run table
Prepared trace of the published program. Some rows group repeated iterations.
Step / lineWhat happensState after stepOutput so far
main identifies the primary content of the document.—
—
h1 supplies the page heading.—
—
p supplies a paragraph. The browser renders these elements; there is no console output.—
—