Comments on: The main element https://stevefaulkner.github.io/html5doctored/the-main-element/ helping you implement HTML5 today Thu, 28 Jul 2016 17:36:34 +0000 hourly 1 By: Danilo https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2118566 Wed, 04 May 2016 10:02:12 +0000 http://html5doctor.com/?p=5081#comment-2118566 Also, I think it should be possible to markup the basic structure with the new sectioning content elements, without any divs (and I know they don’t influence the document’s outline, but still…), because I think that’s what the purpose is.
If this is not possible without wrapping divs, I think there’s either an element missing or one is misdefined.

]]>
By: Danilo https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2118557 Wed, 04 May 2016 09:53:21 +0000 http://html5doctor.com/?p=5081#comment-2118557 Yes, I think a sidebar is main content in the sense that it is neither belonging to a page’s header nor footer.
What you call the main information is already wrapped with article and I don’t want to extra-wrap it with main. In my eyes, main should wrap the content of a page (article + sidebars) in distinction to a page’s header and footer (like in a word document maybe).

]]>
By: Steve Faulkner https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2116588 Wed, 27 Apr 2016 16:29:11 +0000 http://html5doctor.com/?p=5081#comment-2116588 @saurabh
if you have
a header/footer on the page then use main to markup the main content area, refer to Easy content organisation with HTML5.

]]>
By: hestroy https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2111113 Fri, 08 Apr 2016 09:44:18 +0000 http://html5doctor.com/?p=5081#comment-2111113 Danilo,

is a sidebar the main content? I don’t think so.

Use instead.

=

body
– header
– div.content
– nav
– main <—- the main information (article, list of articles etc.)
— aside
–/div.content
– footer

]]>
By: Saurabh chirde https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2110428 Tue, 05 Apr 2016 17:44:09 +0000 http://html5doctor.com/?p=5081#comment-2110428 Is it compulsory to use main in the structure? I mean without using main the output is same right?

P.S – I am new to HTML5 and just started to learn.

]]>
By: Curtis https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2103785 Fri, 18 Mar 2016 14:54:19 +0000 http://html5doctor.com/?p=5081#comment-2103785 Understand how this rule gives the differential for use case between a div tag and a section tag; however, I am curious as to whether or no this means that there should never be an id or class selector attached to the section tag.

I would assume I am just over analyzing, since all of the examples here, and on other sites, show people using id and class selectors on their section tags. It would also make them purely for outlining and a div would then be required one level below the section in order to stylize the defined section.

I guess I am just looking for a more solid assurance that it is okay to use id and class selectors on a section tag as long as the section tag is being properly used.

]]>
By: Danilo https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2065922 Thu, 10 Dec 2015 12:46:30 +0000 http://html5doctor.com/?p=5081#comment-2065922 Thanks. I guess I then will continue to use my nice structure of:

body
– header
– main
— article (for single page/post) OR section (for blog/archive)
— aside
– footer

Even if the aside’s content isn’t unique to the page at hand.

]]>
By: Steve Faulkner https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2065907 Thu, 10 Dec 2015 11:41:03 +0000 http://html5doctor.com/?p=5081#comment-2065907

The problem now is, according to the spec I am only allowed to do it this way when the sidebar contents are unique to the page at hand – which in a WordPress scenario for example is hardly the case.

In practice there is nothing to stop you from doing so, there are no conformance constraints on child elements of main (it can contain any flow content. The definition is designed to discourage use of main as a catchall container.

So this is acceptable:

body
– header
– main
— aside
– footer

]]>
By: Danilo https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2065895 Thu, 10 Dec 2015 10:32:28 +0000 http://html5doctor.com/?p=5081#comment-2065895 There is not only just one article or section within the main element. I like to use main as a wrapper for content + sidebar, so I have this very nice document structure of:

body
– header
– main
– footer

So main isolates the main content from the header/banner and the footer/contentinfo of the document.

Inside main I use an article for a single page/post OR a section of articles for blog/archive pages.

BUT, also inside main, I like to have my sidebar(s), because, in my eyes, they are also main content in the sense that they are not header/footer nor should they be the same level as header/main/footer.

The problem now is, according to the spec I am only allowed to do it this way when the sidebar contents are unique to the page at hand – which in a WordPress scenario for example is hardly the case.

So, much like the aside element, which can now peacefully act as a sidebar element, I’d like to see the main element more freely wrapping content that is neither header/nav nor footer stuff.

And I believe I’m not alone with this.

]]>
By: Steve Faulkner https://stevefaulkner.github.io/html5doctored/the-main-element/#comment-2065557 Wed, 09 Dec 2015 13:45:23 +0000 http://html5doctor.com/?p=5081#comment-2065557 @danilo,
i am unclear what the problem is.

because then it sort of is just a redundant wrapper for article (most of the time anyways – and I do get the difference between main and article).

If there is only one article or section contained in the main element, the redundacy comes from use of section or article not from use of main.

]]>