Semantic menu context

Scott digs into the history of the <menu> element. He traced it as far back as HTML 2 (!) in a 1994 changelog. The vibe then, it seems, was to mark up a list. I would suspect the intention …


The post Semantic menu context appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

Scott digs into the history of the <menu> element. He traced it as far back as HTML 2 (!) in a 1994 changelog. The vibe then, it seems, was to mark up a list. I would suspect the intention is much like <nav> is today, but I really don’t know.

Short story: HTML 4 deprecated it, HTML 5 revived it—this time as a “group of commands”—and then HTML 5.2 deprecated it again. Kind of a bummer since it has some clear use cases.

So, it’s been quite the roller coaster for ol’ <menu>! There never seems to be any easy wins for HTML evolution. As of now, it’s in “don’t bother” territory:

I really wrote this post as a sort of counter point to the often uttered phrase “use semantic HTML and you get accessibility for free!” That statement, on its surface, is largely true. And you should use semantic HTML wherever its use is appropriate. <menu>, unfortunately, doesn’t really give us all that much, even though it has clearly defined semantics. Its intended semantics and what we actually need in reality are better served by either just using the more robust <ul> element, or creating your own role=toolbarmenubar, etc.. Using this semantic element, for semantics sake, is just that.

To Shared LinkPermalink on CSS-Tricks


The post Semantic menu context appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.


Print Share Comment Cite Upload Translate
APA
Chris Coyier | Sciencx (2024-03-29T10:59:09+00:00) » Semantic menu context. Retrieved from https://www.scien.cx/2021/11/11/semantic-menu-context-2/.
MLA
" » Semantic menu context." Chris Coyier | Sciencx - Thursday November 11, 2021, https://www.scien.cx/2021/11/11/semantic-menu-context-2/
HARVARD
Chris Coyier | Sciencx Thursday November 11, 2021 » Semantic menu context., viewed 2024-03-29T10:59:09+00:00,<https://www.scien.cx/2021/11/11/semantic-menu-context-2/>
VANCOUVER
Chris Coyier | Sciencx - » Semantic menu context. [Internet]. [Accessed 2024-03-29T10:59:09+00:00]. Available from: https://www.scien.cx/2021/11/11/semantic-menu-context-2/
CHICAGO
" » Semantic menu context." Chris Coyier | Sciencx - Accessed 2024-03-29T10:59:09+00:00. https://www.scien.cx/2021/11/11/semantic-menu-context-2/
IEEE
" » Semantic menu context." Chris Coyier | Sciencx [Online]. Available: https://www.scien.cx/2021/11/11/semantic-menu-context-2/. [Accessed: 2024-03-29T10:59:09+00:00]
rf:citation
» Semantic menu context | Chris Coyier | Sciencx | https://www.scien.cx/2021/11/11/semantic-menu-context-2/ | 2024-03-29T10:59:09+00:00
https://github.com/addpipe/simple-recorderjs-demo