Tabs in HTML?

Brian Kardell shares a bit about the progress of bringing “Tabs” to HTML. We kinda think we know what they are, but you have to be really specific when dealing with specs and defining them. It’s tricky.


The post Tabs in HTML? appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.


This content originally appeared on CSS-Tricks and was authored by Chris Coyier

You know what tabs are, Brian.

I mean… You use them every day, on every OS. Everybody knows they exist in every toolbox. All that’s left is to “just pave the cowpaths!” But when you get right down to it, it’s a lot more complicated than that.

Brian Kardell shares a bit about the progress of bringing “Tabs” to HTML. We kinda think we know what they are, but you have to be really specific when dealing with specs and defining them. It’s tricky. Then, even if you settle on a solid definition, an HTML expression of that isn’t exactly clear. There are all kinds of expressions of tabs that all make sense in their own way. Imagine marking up tabs where you put all the tabs as a row of links or buttons up top, and then a bunch of panels below that. They call that a “Table of Contents” style of markup, and it makes some kind of logical sense (“the markup looks like tabs already”). But it also has some problems, and it looks like sections-with-headers is more practical (“If you have the heading, you can build the TOC, but not vice-versa”). Spicy sections are a totally different pattern. And that’s just one problem they are facing.

I don’t envy the work, but I look forward to the progress in no small part because authoring tabs is tricky business. Not hard to do, but very hard to do right. I’ve talked in the past about how I’ve built tabs many times in jQuery where just a click handler on a row of links hides or shows some matching divs below. That “works” if you ignore accessibility entirely (e.g. how you navigate between tabs, focus management, ARIA expectations, etc).

Here’s the ShopTalk discussion and here’s a different perspective in a chat I had with Stephen on CodePen Radio where we get into our <Tabs /> React component on CodePen.

Direct Link to ArticlePermalink


The post Tabs in HTML? appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.


This content originally appeared on CSS-Tricks and was authored by Chris Coyier


Print Share Comment Cite Upload Translate Updates
APA

Chris Coyier | Sciencx (2021-08-16T23:31:01+00:00) Tabs in HTML?. Retrieved from https://www.scien.cx/2021/08/16/tabs-in-html/

MLA
" » Tabs in HTML?." Chris Coyier | Sciencx - Monday August 16, 2021, https://www.scien.cx/2021/08/16/tabs-in-html/
HARVARD
Chris Coyier | Sciencx Monday August 16, 2021 » Tabs in HTML?., viewed ,<https://www.scien.cx/2021/08/16/tabs-in-html/>
VANCOUVER
Chris Coyier | Sciencx - » Tabs in HTML?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/16/tabs-in-html/
CHICAGO
" » Tabs in HTML?." Chris Coyier | Sciencx - Accessed . https://www.scien.cx/2021/08/16/tabs-in-html/
IEEE
" » Tabs in HTML?." Chris Coyier | Sciencx [Online]. Available: https://www.scien.cx/2021/08/16/tabs-in-html/. [Accessed: ]
rf:citation
» Tabs in HTML? | Chris Coyier | Sciencx | https://www.scien.cx/2021/08/16/tabs-in-html/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.