About this set
Tabs whose state lives in the URL hash, so a reload keeps the open tab and a pasted link such as #pane-faq opens straight on the right panel. The card has a heading, a segmented tab strip with Overview, Pricing and FAQ, the panels and a short hint. Use it for documentation, pricing or settings pages where people share links to one section. The plain CSS version needs no script at all: the tabs are anchor links, :target shows the panel named in the hash, :has() highlights its link, and a :not(:has(:target)) rule shows the first panel before any hash exists. The Bootstrap version is a .nav-pills strip driven by the Tab plugin plus about ten lines that open the tab named in the hash on load and push the hash when a tab is shown. The Tailwind version is a small WAI-ARIA tabs script with the same hash handling. In every version each click adds a history entry, so the back button steps back through the tabs, and the state survives a reload.
What’s included
- The open tab is kept in the URL hash, so links and reloads land on it
- Plain CSS version works with no JavaScript, using :target and :has()
- Bootstrap .nav-pills with the Tab plugin plus a short hash sync
- Back and forward buttons step through the tabs in every version
- Muted text darkened to reach 4.5:1
Accessibility
The plain CSS version is a nav landmark of in-page links, not ARIA tabs: each link is reached with Tab and followed with Enter, and each panel is a section named by its heading; the current link is marked visually only. The Bootstrap and Tailwind versions follow the WAI-ARIA tabs pattern with role tablist, tab and tabpanel, aria-selected, aria-controls, a roving tabindex, arrow keys plus Home and End. Focus shows a 2px indigo outline, and the colour transitions are removed under prefers-reduced-motion.
Customise it
Change the indigo #4f46e5 and the #f2f5fa strip in .tabs (plain CSS), the --bs-nav-pills-link-active-bg and --bs-nav-link-* variables on .tabs (Bootstrap) or the --color-tab-* theme colours (Tailwind). Rename the panel ids and hrefs together, since the hash is the id.

















