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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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"
Loading ..................