Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <header>
    <h1>Cool Counsellor</h1>
    <h2>Specialization here</h2>
</header>

<div id="container">

    <nav role="tablist">
        <a href="#about" id="about-tab" role="tab" class="active">About</a>
        <a href="#practice" id="practice-tab" role="tab">Practice</a>
        <a href="#fees" id="fees-tab" role="tab">Fees</a>
        <a href="#contact" id="contact-tab" role="tab">Contact</a>
    </nav>

    <section id="about-content" role="tabpanel">
        <h3>About</h3>

        <p>
            Hello! Here's a bit about me and my experience...
        </p>
        <p>
            And a bit more down here in another paragraph.
        </p>

    </section>

    <section id="practice-content" role="tabpanel" class="visuallyhidden">
        <h3>Practice</h3>

        <ul>
            <li>Item 1</li>
            <li>Item 2</li>
            <li>Item 3</li>
            <li>Item 4</li>
        </ul>
    </section>

    <section id="fees-content" role="tabpanel" class="visuallyhidden">
        <h3>Fees</h3>

        <p>
            Details on fees...
        </p>
    </section>

    <section id="contact-content" role="tabpanel" class="visuallyhidden">
        <h3>Contact</h3>

        <p>
            Please email <a href="mailto:bruce@brucelefebvre.com" rel="noopener">bruce@brucelefebvre.com</a> for more information.
        </p>
        <p>
            Office: by appointment only.
        </p>
        
    </section>
</div>
              
            
!

CSS

              
                #container {
  margin: 1em auto;
  display: flex;
  flex-direction: column;
  padding: 0 15px 30px;
}

nav {
  display: flex;
  justify-content: space-between;
}

nav a,
nav a:active,
nav a:focus {
  outline: none;
}

nav a {
  text-decoration: none;
  color: #222;
  padding: 10px 2px 5px 2px;
}
nav a.active {
  border-bottom: 3px solid #555;
}

section {
  margin-top: 1em;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, sans-serif;
}

header {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: white;
  padding: 25px 0 21px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 1.49em;
}

h2 {
  font-size: 1.21em;
}

h3 {
  text-transform: uppercase;
}

@media (min-width: 730px) {
  #container {
    width: 700px;
  }
}

/*
 * Hide only visually, but have it available for screenreaders
 */

.js-enabled .visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard
 */

.js-enabled .visuallyhidden.focusable:active,
.js-enabled .visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}
              
            
!

JS

              
                (function() {
  // Array of known tab names. Update this list when a tab is added.
  var tabs = ["#about", "#practice", "#fees", "#contact"];
  var currentTab = "#about";

  // Open the provided tab name, if it's valid
  function openTab(tabName) {
    // Is this a valid hash?
    if (tabs.indexOf(tabName) < 0) {
      tabName = tabs[0];
    }
    // Hide the current tab
    document.querySelector(currentTab + "-tab").classList.remove("active");
    document
      .querySelector(currentTab + "-content")
      .classList.add("visuallyhidden");

    // Activate new tab
    document.querySelector(tabName + "-tab").classList.add("active");
    document
      .querySelector(tabName + "-content")
      .classList.remove("visuallyhidden");
    currentTab = tabName;

    // Fire Google analytics event
    if (window.ga) {
      var trackingUrl = tabName.replace("#", "/");
      ga("set", "page", trackingUrl);
      ga("send", "pageview");
    }
  }

  // Listen for hash changes
  window.addEventListener(
    "hashchange",
    function hashChangeHandler(e) {
      e.preventDefault();
      if (location.hash) {
        openTab(location.hash);
      }
    },
    false
  );

  // If a hash is provided initially, open the tab if refers to.
  // This enables "deep linking" into the site's pages.
  var initialHash = location.hash;
  if (initialHash) {
    openTab(initialHash);
  }
  
  // JS is enabled! Set a class on the body to enable our 'visuallyhidden' class
  document.body.classList.add("js-enabled");
})();

              
            
!
999px

Console