The tab navigation is an element you often meet in your daily browsing. There are so many ways, so many styles, but the idea is the same: you click a tab and see its content without a page refresh.
In this article you’ll learn how to build some new CSS3 & jQuery tabs inspired by Google Play’s design.
Getting back to this tutorial, here’s the markup, simple as usual. You may notice the similarity between an anchor’s name attribute and related content’s id block. Further, this will be our hook.
The CSS
The goal here, as always, is to do it without using any images and with as little CSS as possible.
That’s all, this is not just a CSS piece, it’s the whole CSS used to create these tabs. I think it’s pretty cool, not even pseudo-elements were used here, just CSS borders.
Deconstructing it
Here’s where the magic happens:
The jQuery
Comparing to my previous tabs article, this time I think I improved a bit the jQuery code. Also, this time you have the possibility to access the tabs directly by URL, e.g. mywebsite.com/tabs.html#tab2.
In the end…
This technique has a small drawback, the tabs do not behave as they should if you’re using IE6. But, with your permission, I’d say we could skip IE6 this time. However, if you really want a graceful degradation for IE6, it can be done with some specific targeting. Maybe I’ll do that in the future, or maybe not :)
I’m looking forward to read your comments, hope you enjoyed this. Thanks for reading it!