DEV Community

Discussion on: HTML5 tags - how do they work, and which ones should I use?

Collapse
 
deathshadow60 profile image
deathshadow60

I'm a firm believer that the "structural" -- or as you call them in a even more horrifying manner "layout" -- tags are nonsensical trash that are at best redundant to H1..H6 and HR, or worse are presentational in nature reverting things back to the worst of 1990's development practices.

For every genuine improvement in HTML 5 -- the more compact HEAD, the absolutely awesome new form element attributes, and so forth -- there's as many if not more things that NEVER should have been added, and reek of having been made by people who never embraced any of the concepts of semantics or HTML 4 Strict.

The mere fact you used the word "layout" confirms this. Layout is presentation, and presentation has ZERO business in HTML. Take aside, where if you use it to mean "this is off to one side" that's NOT semantics, that's as presentational as the old CENTER tag! The only sense in which you would have an ASIDE that would make sense for actual literary/grammatical semantics is if you were transcribing the complete works of Shakespear or writing a slew of Deadpool/Ferris Beuller slashfic.

It's the same reasoning as to why front-end frameworks are mentally enfeebled trash, since if you don't know what's wrong with saying something like class="uppercase tracking-wide text-sm text-indigo-600 font-bold" you might as well go back to writing HTML 3.2 using all those tags so clearly missed like FONT or attributes like ALIGN.

HTML is for saying what things ARE or would be in a professionally written document for grammatical and structural reasons. HTML IS NOT for saying what you want things to look like. If you choose any of your tags, classes, id's, or much of anything else based on the tag's default appearance, you're doing it all wrong!!!

In that way the SECTION tag being redundant to how H1..H6 and even lowly HR mark the start of sections, or how MAIN is (or should be) redundant to the first H2 on the page, or how HEADER is redundant to the existing headings, or how FOOTER is redundant to an HR if it's followed by another HR or a higher order heading.... pointless redundancies CLAIMING to be semantic when they serve the exact opposite purpose.

It all seems to take a giant whiz on separation of presentation from content and efficient coding practices. It seems to be even more bent on undoing all the progress HTML 4 Strict was out to create and drag things back to the worst of 1990's era browser-wars thinking of development.

As a dearly departed friend of mine said a decade ago, the people who used to vomit up endless pointless tables for nothing now just barf out endless pointless DIV for nothing. He'd shudder in horror to see the same derpy approach being part of the specification, much less the endless pointless "markup for nothing" having a false claim of "semantics" or "structure" thrown atop it just to justify bad coding practices.

Collapse
 
tonjohn profile image
Burton

The semantic tags improve accessibility / lower the bar for building more accessible sites.

Collapse
 
deathshadow60 profile image
deathshadow60

Yes, the semantic tags -- H1..H6, HR, P, UL, OL, etc, etc... But these new "structural" tags? HEADER, FOOTER, ARTICLE, SECTION, ASIDE, MAIN, NAV are about as semantic as FONT, CENTER, or using TABLE for layout.

The only one that might actually server a legitimate purpose from a semantic markup standpoint (aka not giving a flying fig about layout and focusing on grammar and logical document structure in a professional writing sense) is MAIN, and that's just as a hook when for some bizzaroland reason you might have other headings besides the H1 before the main content's H2.

But as always with most people having zero clue what H1..H6 and HR actually mean and failing to use them even remotely properly, it's hardly a shock such derpy markup practices are thriving -- again like the worst of browser-wars era practices.

Collapse
 
metalmikester profile image
Michel Renaud

It sounds like you have a subject for a good and interesting article.

Collapse
 
bbarbour profile image
Brian Barbour

This is a weird hill to die on. 🤷