cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <h1>Top rated craft beers</h1>
<div id="tabs">
        <li><a href="#ipa">India Pale Ale (IPA)</a></li>
        <li><a href="#gueuze">Gueuze</a></li>
        <li><a href="#imperial-stout">Imperial Stout</a></li>
        <h2 id="ipa">India Pale Ale (IPA)</h2>
            <li><strong>Hill Farmstead:</strong> Susan</li>
            <li><strong>Trillium:</strong> Melcher Street - Double Dry Hopped</li>
            <li><strong>Tree House:</strong> Julius</li>
            <li><strong>AleSmith:</strong> IPA</li>
            <li><strong>Alchemist:</strong> Focal Banger</li>
            <li><strong>Grassroots:</strong> Legitimacy</li>
            <li><strong>Tree House:</strong> Alter Ego</li>
            <li><strong>Bells:</strong> Two Hearted Ale</li>
            <li><strong>New England:</strong> Fuzzy Baby Ducks IPA</li>
            <li><strong>Ballast Point:</strong> Sculpin IPA</li>
        <h2 id="gueuze">Gueuze</h2>
            <li><strong>3 Fonteinen:</strong> Zenne y Frontera</li>
            <li><strong>3 Fonteinen:</strong> Oude Geuze Vintage</li>
            <li><strong>3 Fonteinen:</strong> Oude Geuze Golden Blend</li>
            <li><strong>Bullfrog:</strong> Le Roar Grrrz</li>
            <li><strong>Oude (Gueuze Tilquin):</strong> à l’Ancienne</li>
            <li><strong>Girardin:</strong> Gueuze Black Label</li>
            <li><strong>Cantillon:</strong> 50°N-4°E</li>
            <li><strong>3 Fonteinen:</strong> Oude Geuze</li>
            <li><strong>Cantillon:</strong> Lou Pepe Gueuze</li>
            <li><strong>Lindemans:</strong> Oude Gueuze Cuvée René Special Blend 2010</li>
        <h2 id="imperial-stout">Imperial Stout</h2>
            <li><strong>Toppling Goliath:</strong> Mornin’ Delight</li>
            <li><strong>Three Floyds:</strong> Dark Lord Russian Imperial Stout (Bourbon Barrel Aged)</li>
            <li><strong>AleSmith:</strong> Speedway Stout - Bourbon Barrel Aged</li>
            <li><strong>Three Floyds:</strong> Dark Lord Russian Imperial Stout (Bourbon Vanilla Bean)</li>
            <li><strong>Founders:</strong> Backstage Series # 2: CBS (Canadian Breakfast Stout)</li>
            <li><strong>AleSmith:</strong> Speedway Stout</li>
            <li><strong>Cigar City:</strong> Hunahpu’s Imperial Stout</li>
            <li><strong>Bells:</strong> Expedition Stout</li>
            <li><strong>Three Floyds:</strong> Dark Lord Russian Imperial Stout</li>
            <li><strong>Founders:</strong> KBS (Kentucky Breakfast Stout)</li>
              body {
  margin: 2em;

#tabs {
    max-width: 50em;

#tabs h2 {
    margin: 1em 0 0;

#tabs h2:focus {
    outline: 0;
    /* If you're removing the outline, you must add something as good or better! */
    text-decoration: underline;

.tabsList {
    float: left;
    list-style: none;
    margin: 0;
    padding-left: 2.35em;

.tabsList li {
    position: relative; /*for z-index*/
    float: left;
    margin: 0 .5em 0 0;
    z-index: 1;

.tabsList li a {
    position: relative;
    top: 4px;
    float: left;
    overflow: hidden;
    font-weight: normal;
    text-shadow: none;
    background: #fff;
    color: #444;
    text-decoration: none;
    margin: .5em 0 0;
    padding: .5em .5em .35em;
    border-style: solid;
    border-color: #ccc;
    border-width: 2px 2px 0;
    -moz-border-radius-topleft: 0.5em;
    -moz-border-radius-topright: 0.5em;
    -webkit-border-top-left-radius: 0.5em;
    -webkit-border-top-right-radius: 0.5em;
    border-top-left-radius: 0.5em;
    border-top-right-radius: 0.5em;
    cursor: pointer;

.tabsList li a:link { border-color: #ccc; }

.tabsList li a:hover,
.tabsList li a:focus,
.tabsList li a:active {
    border-color: #999;
    text-shadow: 0 1px 1px rgba(0, 0, 0,.2);

.tabsList li a:active { top: 2px; }

.tabsList li.current { z-index: 10; }

.tabsList li.current a {
    top: 2px;
    font-weight: bold;
    color: #333;
    background: #fafafa;
    border-color: #999;
    text-shadow: 0 1px 1px rgba(0, 0, 0,.2);

.tabsList li.current a:hover,
.tabsList li.current a:focus {
    color: #333;
    background-color: #fafafa;

.tabsList li.current a:focus { outline: 1px dotted #444; }

.tabsList a span {
    position: absolute;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;

.tabPanel {
    position: relative;  /*for z-index*/
    display: block;
    visibility: visible;
    clear: left;
    overflow: auto;
    padding: .5em 3em 2em;
    border: 2px solid #999;
    -moz-border-radius: 1em;
    -webkit-border-radius: 1em;
    border-radius: 1em;
    z-index: 5;
    color: #333;
    background-color: #fafafa;

.tabPanel:focus { outline: 1px dotted #999; }

.tabPanel h2 { display: inline-block; }

.tabPanel h2:focus { outline: 1px dotted #999; }
              $(function() {
    var tabs = $("#tabs");

    // For each individual tab DIV, set class and aria-hidden attribute, and hide it
    $(tabs).find("> div").attr({
        "class": "tabPanel",
        "aria-hidden": "true"

    // Get the list of tab links
    var tabsList = tabs.find("ul:first").attr({
        "class": "tabsList",

    // For each item in the tabs list...
    $(tabsList).find("li > a").each(
            var tab = $(this);

            // Create a unique id using the tab link's href
            var tabId = "tab-" + tab.attr("href").slice(1);

            // Assign tab id and aria-selected attribute to the tab control, but do not remove the href
                "id": tabId,
                "aria-selected": "false",
            }).parent().attr("role", "presentation");

            // Assign aria attribute to the relevant tab panel
            $(tabs).find(".tabPanel").eq(a).attr("aria-labelledby", tabId);

            // Set the click event for each tab link
                    var tabPanel;

                    // Prevent default click event

                    // Change state of previously selected tabList item
                    $(tabsList).find("> li.current").removeClass("current").find("> a").attr("aria-selected", "false");

                    // Hide previously selected tabPanel
                    $(tabs).find(".tabPanel:visible").attr("aria-hidden", "true").hide();

                    // Show newly selected tabPanel
                    tabPanel = $(tabs).find(".tabPanel").eq(tab.parent().index());
                    tabPanel.attr("aria-hidden", "false").show();

                    // Set state of newly selected tab list item
                    tab.attr("aria-selected", "true").parent().addClass("current");

                    // Set focus to the first heading in the newly revealed tab content
                    tabPanel.children("h2").attr("tabindex", -1).focus();

    // Set keydown events on tabList item for navigating tabs
    $(tabsList).delegate("a", "keydown",
        function (e) {
            var tab = $(this);
            switch (e.which) {
                case 37: case 38:
                    if (tab.parent().prev().length!=0) {
                        tab.parent().prev().find("> a").click();
                    } else {
                        $(tabsList).find("li:last > a").click();
                case 39: case 40:
                    if (tab.parent().next().length!=0) {
                        tab.parent().next().find("> a").click();
                    } else {
                        $(tabsList).find("li:first > a").click();

    // Show the first tabPanel
    $(tabs).find(".tabPanel:first").attr("aria-hidden", "false").show();

    // Set state for the first tabsList li
    $(tabsList).find("li:first").addClass("current").find(" > a").attr({
        "aria-selected": "true",
        "tabindex": "0"
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................