Closed kettanaito closed 8 years ago
Yes, once we drop support for IE8 we can start using HTML5 semantic elements. But instead IDs use classes with BEM in mind. I would not suggest to use any linter for this. IMHO we don’t need to be strict here (nobody knows how it should be :-)). In future we will write HTML with BE technologies (.NET, Java templates) or maybe in React.
How about to prepare HTML5 structure skeleton for our development stack?
I have noticed a few things, which IMHO may be changed to be more up to HTML5 specification:
.main
. Main should represent the content directly related to the purpose of the page. Header and footer are general components, thus should be moved outside the main container<div>
for main content container. We may use<main>
which serves specifically this purpose - highlighting the main content of the page. Support for HTML5 semantic tags is pretty decentIn general, for our
default.nunj
to look similar to this:The following also includes to maintain proper HTML5 tag choice throughout the process of creating a layout. It may be useful to hold a lecture regarding how to use this specification effectively.
There are HTML linters out there, but I have not studied them thoroughly enough. Tricky part about it, is to make a right choice when picking an element. This is unlikely to be validated by a machine.
Restrictions
Following the rules may be troublesome sometimes. Lets say we need to include an email subscription section. Should it be inside
<main>
? No. Should it be inside<footer>
? No again. It does not contribute to the main content of the page, and is a semantically separate block. This is where hooks may come in handy:This may allow to insert any content to a predefined places (typically one after header and one before footer).
This topic is, of course, open to discussion. Thank you.