css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

A lot of CSS tabs need either the tab content or labels to be position absoluted, or sacrifice the selected state on the tabs.

This uses flexbox and order to have both.

It also allows you to drop down to an accordion when on mobile.

Comments

  1. very useful! thanks! )

  2. This is really great, but after updating to Firefox 52 today, the tabs are misaligned. Anyone know why? Chrome's fine...

  3. @xcartmods - I can confirm this is true. Can't figure it out though....

  4. @mikestreety

    Adding

    display: none;

    to

    .tabs input[type="radio"] { ... }

    Seems to fix it.

  5. This is really great but how to make it hover tab instead of click the tab to display the content below?

  6. So dope! Thanks!

  7. Thanks for this pen. It presented as the perfect solution for what I was working on; credit given for sure.

  8. I can't understand. Responsive (smartphones) works perfectly run through Code Pen site, but when i export, it doesn't work well at smartphones. (tested using chrome "toggle device toolbar"). Someone knows why?

    Thanks you, anyway. It's a great work!

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.
Loading...
Loading...