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 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.
Here’s where the magic happens:
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!