I didn't think I would like this as much as I do. Pretty awesome stuff actually. The main tag example you mentioned does have it's drawbacks since you'd have to identify and group collections of main tags in order to iterate through them in any meaningful way. Perhaps not as semantically beneficial, since one would usually do something along those lines with div tags anyway; div#home, div#page-1, etc...
To use the main tag properly it should be used like void main in C++, there can be only one!
Full-time web dev; JS lover since 2002; CSS fanatic. #CSSIsAwesome
I try to stay up with new web platform features. Web feature you don't understand? Tell me! I'll write an article!
He/him
Right, and typically that's the idea. The only case where I can imagine wanting multiple <main> elements is as a short-term measure to basically preload some content in a <main hidden>, then show it and hide the other simultaneously, and delete the old one. As a variation, in a situation where you're moving through pages sequentially (chapters in an online book, for example), I could imagine keeping the previous and next both loaded in <main hidden>s, but more than that seems like a bad idea (though I'm open to counter examples)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I didn't think I would like this as much as I do. Pretty awesome stuff actually. The main tag example you mentioned does have it's drawbacks since you'd have to identify and group collections of main tags in order to iterate through them in any meaningful way. Perhaps not as semantically beneficial, since one would usually do something along those lines with div tags anyway; div#home, div#page-1, etc...
To use the main tag properly it should be used like void main in C++, there can be only one!
Right, and typically that's the idea. The only case where I can imagine wanting multiple
<main>
elements is as a short-term measure to basically preload some content in a<main hidden>
, then show it and hide the other simultaneously, and delete the old one. As a variation, in a situation where you're moving through pages sequentially (chapters in an online book, for example), I could imagine keeping the previous and next both loaded in<main hidden>
s, but more than that seems like a bad idea (though I'm open to counter examples)