Underline or pill style

CSS Tabs Generator

Build a tabbed content switcher with your own labels and content, then copy the ready-to-use HTML, CSS and JavaScript.

Ready-to-use HTML + CSS + JS

How it works

1

Edit each tab

Set the label and content text for every tab in the set.

2

Pick a style

Choose an underline indicator or a rounded pill-style active state.

3

Copy the code

Get accessible, ready-to-use HTML, CSS and JavaScript.

FAQ

How does clicking a tab switch the content?

A small script toggles an "active" class on the clicked tab button and shows the matching panel by index, hiding the others.

What's the difference between underline and pill style?

Underline style highlights the active tab with a bottom border, while pill style gives the active tab a fully rounded background, similar to a segmented control.

Is the generated tab set accessible?

The buttons use role="tab" and aria-selected, and the panels use role="tabpanel", giving assistive technology the standard tab pattern semantics.

Try other tools