How to make tabs using only CSS
silvestarbistrovic.from.hr
silvestarbistrovic.from.hr
If you ask yourself, what is the purpose of CSS vs JavaScript, you will see that this type of functionality probably falls outside the scope of what CSS is meant to do. Also it may take extra time to explain how this works to every new developer. Also accessibility.
ignoring the fact that there's no :active styling in the css, there is nothing to indicate that to change the tab you need to use different keys
Probably people will end up using JS for this, and that's OK, but I really think this approach actually fits the way standards "define" HTML and CSS.
I've actually just spent a little while this afternoon playing with this, since it is so much better. I've got a nice new workaround that'll make this work nicely if you'd prefer to use :target too: https://medium.com/@pimterry/better-css-only-tabs-with-targe...
If you are creating tabs with pure CSS, the only real reason to do so is for educational purposes, especially considering this is an article about code and not just code.
Then the author decides to use SCSS and some very non-standard flexbox grid layout library... so that nobody can learn from this? Nobody who is just learning CSS will understand SCSS syntax, and nobody wants to learn a new library just to understand an article about CSS.
This trick with radio input is old, but good to know
However, the tabs will be discontinued in the next major version; the html markup becomes way too ugly, unmanageable and rigid. It started as an experiment but sure enough, now that I don't consider the library itself an experiment I think it's time to clean up the mess.
Abusing tags would be "using HTML and CSS" or cheating.
[1] https://github.com/maliMirkec/csstabs
I don't think I'm going to be taking this CSS lesson.
You are jumping to a conclusion on a mere speculation. The site works fine with uBO + default settings/filter lists. I could not even "break" the site using "medium mode", which blocks all 3rd-party scripts/frames.