HTML5 Main Element

Michael Walsh
By Michael WalshPublished

A quick look at the new HTML5 <main> element and how to implement it.

The HTML5 <main> element seems to have crept into the W3C HTML specification with little fanfare. Despite the fact that it’s probably one of the elements HTML has been lacking most, particularly from an accessibility perspective.

It’s very simple to implement, with some common sense rules. In my experience it’s been very quick to change the element that has the ARIA’s landmark role of “main” in our markup to the new <main> element.

The rules to obey when implementing the <main> element are:

  1. You can only include one main element per document - although this is currently a point of contention so may change.
  2. It cannot be used as a child of an <article>, <header>, <footer>, <aside>, or <nav> element.

Because <main> isn’t sectioning content, it doesn’t affect the document outline in the same way <article>, <nav>, or <section> do.

We use cookies to make this website work, to understand how it's used, and to measure our advertising. Find out more about cookies.

Cookie preferences

make an enquiry

Quick form · 3 steps · 1 min

How can we help?

Pick the closest match. We reply within one business day.

I am looking for

Website

New marketing website, microsite or redesign

E-commerce

Shopify store, new or rebuilt

Web application From £10,000 + VAT

Bespoke software and internal tools

AI implementation From £10,000 + VAT

Practical AI in your existing systems

Data visualisation From £10,000 + VAT

Dashboards and data pipelines

Migrations, hosting & support

Website migrations, web hosting and ongoing support

Something else / not sure yet

Let's talk it through

Prefer to talk?Book a call

Step 1 of 3

We'll be in touch within one business day to discuss your project. In the meantime, feel free to drop us a line at hello@enovate.co.uk if anything else comes up.

book directly

Book a discovery call with Michael

Michael Walsh, Founder & Managing Director. Pick a time that suits you, add your name and email, and the calendar invitation is yours.

Loading available times…

You can still book through the full calendar, orsend us a message.

Times shown in . The calendar invitation lands in your inbox the moment you confirm.

Booking is handled by Calendly; see our privacy policy.

You're booked in

(). The calendar invitation is on its way to .

RescheduleCancel