[whatwg] A plea to Hixie to adopt <main>

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Wed Nov 7 13:07:10 PST 2012


On Thu, Nov 8, 2012 at 3:00 AM, Markus Ernst <derernst at gmx.ch> wrote:

> Am 07.11.2012 15:48 schrieb Jukka K. Korpela:
>
>  I suppose that the heuristics would include recognizing a <div> element
>> to which class "main" has been assigned. Then one could argue that
>> <main> is not needed, as authors can keep using <div class="main">, as
>> millions of pages use.
>>
>
> I doubt that this is useable for that kind of heuristics anyway - as there
> is no standard for this, "main" as a class name may indicate the main
> contents, but also a main container to center the whole page. Also,
> non-english speaking coders may use their own language words as id or class
> names.
>

Agreed.

Looking at existing uses of <div class="main"> to analyse whether we need a
<main> element really doesn't make sense to me. I firmly believe that
class="main" is mostly used for CSS purposes and not for semantic (and thus
accessibility) purposes.

Instead, we should be looking at pages that use <xxx role=main> or more
traditionally in older Web pages use a "skip to main" link as the use cases
for a <main> element. Sometimes that may co-incide with <div class="main">,
but not in general.

Therefore, I don't actually think that the introduction in Steve's
document  is making a good case for the existence of the element with this
sentence:
"The main element formalises the common
practice<https://dvcs.w3.org/hg/html-extensions/raw-file/tip/maincontent/index.html#common>of
identification of the main content section of a document using the
id values such as 'content' and 'main'."

I'd suggest explaining that there is currently no explicit means of
identifying with 100% accuracy what part of a Web page is the single most
important part. Instead we have a solution only for accessibility purposes
with the @role="main" ARIA attribute, or more traditionally by providing a
"skip to main" link on the top of the page. If there was a <main> element
that semantically identified the important part of a Web page, that would
improve accessibility, but also enable for example search engines to give
that part of a Web page a higher importance.

On that latter part: I am always annoyed when a search engine gives me
links to a particular topic that I was searching for which is only
mentioned in a side bar as some related information. It would be possible
to exclude such content if there was a <main> element. The argument that
<article> and <aside> etc. will do away with such problems relies on
authors actually making use of these elements. I am yet to see that happen
- in fact I have seen people that started using these elements go away from
them again, since they don't seem to have any obvious advantage. <main> on
the other hand has a very real advantage - immediately for accessibility -
and its easier to put a single <main> element on a page than to introduce a
whole swag of new elements. It's the simplicity of that single element that
will make it immediately usable by everyone, will reduce the probability of
authoring error, and thus make it reliable for search engines and other
semantic uses.

Regards,
Silvia.



More information about the whatwg mailing list