Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <nav class="container">
  <div class="row">
    <!-- Menu Left -->
    <div class="six columns">
      <h3><i class="fa fa-home"></i> Your Home</h3>

      <ul class="main-menu">
        <li>
          <h4 class="sub-menu">Gas and Electricity <i class="fa fa-chevron-down closed"></i></h4>

          <ul class="closed">
            <li>Gas and electricity tariffs</li>
            <li>Pay As You Go tariffs</li>
            <li>Quick energy estimate</li>
            <li>Prices and tariff information</li>
            <li>Billing and payment</li>
            <li>Trouble paying your bill</li>
            <li>Your meter</li>
            <li>Give us a meter read</li>
            <li>Moving house</li>
            <li>Pay As You Go</li>
            <li>Switching to us</li>
            <li>FAQs</li>
          </ul>
        </li>
        <li>
          <h4 class="sub-menu">Phone and Broadband <i class="fa fa-chevron-down closed"></i></h4>

          <ul class="closed">
            <li>Phone and Broadband Packages</li>
            <li>Phone Packages</li>
            <li>Prices</li>
            <li>Useful information</li>
            <li>Moving house</li>
            <li>FAQs</li>
          </ul>
        </li>
        <li>
          <h4 class="sub-menu">Heating and Wiring <i class="fa fa-chevron-down closed"></i></h4>

          <ul>
            <li>Shield - Care & Servicing</li>
            <li>Gas Installations</li>
            <li>tado° Smarter Heating</li>
            <li>Discounted Energy Efficient Installs</li>
            <li>FAQs and How To</li>
            <li>Contact Us</li>
            <li>Complaints procedure</li>
          </ul>
        </li>
        <li>
          <h4 class="sub-menu">Being Green <i class="fa fa-chevron-down closed"></i></h4>

          <ul>
            <li>Insulation</li>
            <li>Energy Efficiency</li>
            <li>Energy Saving Tips</li>
            <li>Energy Efficiency Survey</li>
            <li>Feed-In Tariffs</li>
            <li>Green Deal</li>
          </ul>
        </li>
        <li>
          <h4 class="sub-menu">Help and Advice <i class="fa fa-chevron-down closed"></i></h4>

          <ul>
            <li>Billing and Payment</li>
            <li>Tariff Comparison Rate</li>
            <li>Your Meter</li>
            <li>Smart Meters</li>
            <li>iplan</li>
            <li>Safety and Emergencies</li>
            <li>Moving House</li>
            <li>Extra Help</li>
            <li>Contact Us</li>
            <li>Regulatory & Guidance Information</li>
            <li>Treating Customers Fairly</li>
            <li>Complaints Procedure</li>
            <li>FAQs</li>
          </ul>
        </li>
        <li>About Us</li>
      </ul>
    </div>

    <!-- Menu Right -->
    <div class="six columns">
      <h3><i class="fa fa-cogs"></i> Site Options</h3>

      <ul class="site-options">
        <li>Cookies</li>
        <li>Low Graphics Version</li>
        <li>Contact Us</li>
        <li>Careers</li>
        <li>Sitemap</li>
      </ul>
    </div>

  </div>
</nav>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Lato:300,400);
/* Grid System */

* {box-sizing: border-box;}

.container {
  max-width: 1020px;
  position: relative;
  margin: 0 auto;
  padding: 0 10px;
  zoom: 1;
  /* For IE 6/7 (trigger hasLayout) */
}

.container:before,
.container:after {
  content: "";
  display: table;
}

.container:after {
  clear: both;
}

.row {
  zoom: 1;
  /* For IE 6/7 (trigger hasLayout) */
}

.row:before,
.row:after {
  content: "";
  display: table;
}

.row:after {
  clear: both;
}

.columns {
  float: left;
  display: block;
  margin-left: 1.5%;
  margin-bottom: 18px;
  vertical-align: top;
}

.columns:first-child {
  margin-left: 0;
}

.columns.six {
  width: 49.25%;
}

/* Main Body */
html {
  height: 101%; /*added to stop the page jumping left when it adds the scroll bar */
}

body {
  font-family: 'Lato', 'Arial', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.4;
  background: rgba(0, 79, 143, 0.9);
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.column,
.columns {
  color: #ffffff;
  text-align: center;
}

h3 {
  color: #ffffff;
  background: #47525d;
  margin: 20px 0;
  padding: 10px;
}
/* Menu Bar */

header {
  background: #fff;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  -webkit-box-shadow: 1px 1px 2px 3px #ccc;
  /* Safari 3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
  
  -moz-box-shadow: 1px 1px 2px 3px #ccc;
  /* Firefox 3.5 - 3.6 */
  
  box-shadow: 1px 1px 2px 3px #ccc;
  z-index: 1000;
}

.main-menu-icon {
  float: right;
  font-size: 38px;
  cursor: pointer;
}
/* Off Screen Nav */

section.offscreen-menu {
  background: #004F8F;
  background: rgba(0, 79, 143, 0.9);
  position: fixed;
  width: 100%;
  height: 100%;
  height: 100vh;
  overflow-y: scroll;
  padding-top: 100px;
  top: 0;
  left: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translate(0, -150%);
  transform: translate(0, -150%);
  transition: all 1s;
  z-index: 500;
}

section.offscreen-menu.open {
  -webkit-transform: translate(0, 0);
  transform: translate(0, 0);
}
/*Menu Options */

h4 {
  padding: 10px 0;
  transition: all 1s;
  cursor: pointer;
}

h4.submenu-open {
  background: #418838;
}

ul.main-menu {
  position: relative;
}

ul.main-menu li,
ul.site-options li {
  margin: 20px 0;
}

ul.main-menu li ul {
  color: #73b73e;
  display: none;
  position: relative;
  max-height: 1000px;
  /*fallback for FireFox */
  
  height: 100%;
}

ul.main-menu li ul.open {
  display: block;
}

ul.main-menu li i {
  transition: all 0.5s;
  position: absolute;
  right: 10px;
}

ul.main-menu li i.closed {
  transform: rotate(0deg);
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
}

ul.main-menu li i.open {
  transform: rotate(-180deg);
  -webkit-transform: rotate(-180deg);
  -moz-transform: rotate(-180deg);
}

@media screen and (max-width: 550px) {
  .columns.six {
    width: 100%;
    margin: 10px 0;
  }
}
              
            
!

JS

              
                // Menu Items Slidetoggle
$('.sub-menu').click(function() {
  $(this).toggleClass('submenu-open').parent('li').siblings('li').children('h4.submenu-open').removeClass('submenu-open');
  $(this).parent().toggleClass('submenu-open').children('ul').slideToggle(500).end().siblings('.submenu-open').removeClass('submenu-open').children('ul').slideUp(500);
$('html, body').animate({
            scrollTop: (0),
        }, "fast"); /*this will scroll upto the top, not sure if I want to use this yet */
});
              
            
!
999px

Console