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 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

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

              
                <div class="outer-wrap">
  <header class="masthead">
    <div class="sidebar-switcher">
      Select layout: <a href="#" class="sidebar-left-toggle"><i class="fa fa-align-left"></i><span class="screen-reader-text">Move sidebar to the left</span></a> <a href="#" class="sidebar-right-toggle"><i class="fa fa-align-right"></i><span class="screen-reader-text">Move sidebar to the right</span></a> <a href="#" class="no-sidebar-toggle"><i class="fa fa-align-justify"></i><span class="screen-reader-text">Display content vertically</span></a>  <a href="#" class="hide-sidebar-toggle"><i class="fa fa-arrow-circle-right"></i><span class="screen-reader-text">Remove sidebar</span></a>
    </div><!-- .sidebar-switcher -->
    
  <div class="centered">
    <div class="site-branding">
      <h1 class="site-title">Flexbox - Full Site Demo</h1>
    </div><!-- .site-title -->
  </div><!-- .centered -->

    <div class="main-menu">
      <div class="nav-mixed menu">
        <nav id="multi-level-nav" class="multi-level-nav" role="navigation">
          <ul>
            <li><a href="#">Home</a></li>
            <li class="has-children">
              <a href="#">Team<button class="dropdown-toggle" aria-expanded="false"><span class="screen-reader-text">Expand child menu</span></button></a>
              <ul class="sub-menu">
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
              </ul>
            </li>
            <li class="has-children">
              <a href="#">Services<button class="dropdown-toggle" aria-expanded="false"><span class="screen-reader-text">Expand child menu</span></button></a>
              <ul class="sub-menu">
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
                <li><a href="#">Subitem</a></li>
              </ul>
            </li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
          </ul>
        </nav><!-- #multi-level-nav .multi-level-nav -->

        <nav id="social-menu" class="social-menu" role="navigation">
          <ul>
            <li><a href="https://twitter.com/bugsyAlexander"><span class="screen-reader-text">Twitter</span></a></li>
            <li><a href="https://github.com/bugsyAlexander"><span class="screen-reader-text">Github</span></a></li>
            <li><a href="https://www.linkedin.com/pub/mynor-alexander/5b/943/877"><span class="screen-reader-text">LinkedIn</span></a></li>
            <li><a href="http://dribbble.com"><span class="screen-reader-text">Dribbble</span></a></li>
            <li><a href="http://instagram.com"><span class="screen-reader-text">Instagram</span></a></li>
          </ul>
        </nav> <!-- .social-menu -->
      </div><!-- .mixed-menu -->
      </div><!-- main-menu -->
    </header><!-- .masthead -->

    <div class="content">
      <main class="main-area">
      <div class="centered">
        <section class="cards">
          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/810/610" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Whiskey</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatum explicabo consequatur consectetur fugit molestias perferendis, sint error iste ut, facilis sunt natus optio dolor nesciunt laboriosam obcaecati corporis numquam.</p>
              </div> <!-- .card-content -->
            </a>
          </article><!-- .card -->

          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/800/610" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Fluffy</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatum explicabo consequatur consectetur fugit molestias perferendis, sint error iste ut, facilis sunt natus optio dolor nesciunt laboriosam obcaecati corporis numquam?</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatum explicabo consequatur consectetur fugit molestias perferendis, sint error iste ut, facilis sunt natus optio dolor nesciunt laboriosam obcaecati corporis numquam?</p>
              </div><!-- .card-content -->
            </a>
          </article><!-- .card -->

          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/816/610" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Kitty</h2>
                <p>  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
              </div><!-- .card-content -->
            </a>
          </article><!-- .card -->

          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/816/600" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Patches</h2>
                <p>  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
              </div><!-- .card-content -->
            </a>
          </article><!-- .card -->

          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/820/620" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Duchess</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
              </div><!-- .card-content -->
            </a>
          </article><!-- .card -->

          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/810/610" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Puchies</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
              </div><!-- .card-content -->
            </a>
          </article><!-- .card -->

          <article class="card">
            <a href="#">
              <figure class="thumbnail">
                <img src="http://placekitten.com/808/608" alt="meow">
              </figure>
              <div class="card-content">
                <h2>Panchito</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati recusandae expedita doloribus dicta cumque nostrum, autem eaque soluta atque voluptatem est et, laborum dignissimos error sequi non? Recusandae, aut alias.</p>
              </div><!-- .card-content -->
            </a>
          </article><!-- .card -->

        </section><!-- .cards -->
      </div><!-- .centered -->
      </main><!-- main-area -->

      <div class="sidebar">
        <div class="squish-container">
          <h3>Explore the other Demos:</h3>
          <nav class="example-menu">
            <ul>
              <li><a href="https://codepen.io/bugsyAlexander/pen/xGBaaG" target="_blank">Mixed Menu</a></li>
              <li><a href="https://codepen.io/bugsyAlexander/pen/gpyYOo" target="_blank">Card Layout</a></li>
              <li><a href="https://codepen.io/bugsyAlexander/pen/OVGLmo" target="_blank">Holy Grail</a></li>
              <li><a href="https://codepen.io/bugsyAlexander/pen/xGNZao" target="_blank">Site Demo</a></li>
            </ul>
          </nav><!-- .example-menu -->
        </div>
      </div><!-- .sidebar -->
    </div><!-- .content -->

  <footer class="footer-area">
    <p>&copy; 2015 Some copyright message - All rights reserved</p>
  </footer>
</div><!-- .outer-wrap -->
              
            
!

CSS

              
                /*--------------------------------------------------------------
Accessibility
--------------------------------------------------------------*/
/* Text meant only for screen readers */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.screen-reader-text:hover,
.screen-reader-text:active,
.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/*--------------------------------------------------------------
Layouts
--------------------------------------------------------------*/
body {
  background: #ecf0f1;
  line-height: 1.4;
  font-family: sans-serif;
}

.card-content h2 {
  font-size: 2em;
  color: #e74c3c;  
}

.centered {
  margin: 0 auto;
  padding: 0 1em;
}

@media screen and (min-width: 52em) {
  .centered {
    max-width: 52em;
  }
}

/*--------------------------------------------------------------
Header styles minus menu
--------------------------------------------------------------*/
.masthead {
  background: #e74c3c;
}

.site-title {
  margin: 0 0 1em;
  padding: 1em 0;
  font-size: 2em;
  font-weight: 300;
  text-align: center;
  color: #FFF;
}

@media screen and (min-width: 44.44em) {
  .site-title {
    font-size: 2em;
  }
}

@media screen and (min-width: 50em) {
  .site-title {
    font-size: 2.5em;
  }
}

.site-title a {
  color: hsl(5, 45%, 95%);
  text-decoration: none;
}

.site-title a:hover {
  text-decoration: underline;
}

/*--------------------------------------------------------------
Base styles
--------------------------------------------------------------*/
.site-title {
  margin-bottom: 0;
}

.main-menu {
  padding: .4em 1em;
  color: white;
  background: hsl(0, 0%, 15%);
}

.post-content {
  padding: 0 1.4em 1.4em;
}

.sidebar {
  padding: .5em 1.4em 1em;
  background: hsl(0, 0%, 90%);
  overflow: hidden;
}

.example-menu ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.example-menu a {
  display: block;
  padding: .4em 0;
  color: inherit;
  text-decoration: none;
  transition: all 0.5s ease;
}

.example-menu a:hover,
.example-menu a:focus {
  padding: .4em 1em;
  background: hsl(0, 0%, 20%);
  color: white;
}

.footer-area {
  padding: .4em 1em;
  text-align: center;
  background: hsl(0, 0%, 75%);
}

/* Sidebar switcher buttons */
@media screen and (max-width: 40em) {
  /* Hide switcher on small screens */
  
  .sidebar-switcher {
    display: none;
  }
}

@media screen and (min-width: 40em) {
  .sidebar-switcher {
    position: absolute;
    right: 0;
    padding: .4em 1em;
    color: #FFF;
  }
  .sidebar-switcher a {
    color: #FFF;
    padding-left: .4em;
  }
  .sidebar-switcher a:hover,
  .sidebar-switcher a:focus {
    color: #FFF;
  }
}

/*--------------------------------------------------------------
Flexbox styles
--------------------------------------------------------------*/
@media screen and (min-width: 40em) {
  .outer-wrap {
    display: flex;
    flex-direction: column;
  }
  .content {
    display: flex;
  }
  .post-content {
    max-width: 40em;
    margin: 0 auto;
  }
  .main-area {
    flex: 1 1 auto;
    order: 1;
  }
  .sidebar {
    flex: 0 0 12em;
    order: 2;
  }
  .sidebar-left {
    order: 0;
  }
  .no-sidebar {
    flex-direction: column;
  }
  .hide {
    flex: 0 0 0;
    padding: 0;
    color: hsla(0, 0%, 0%, 0);
    transition: color .2s ease, flex .5s ease .3s, padding .5s ease .3s;
  }
  .hide a {
    color: hsla(0, 0%, 0%, 0);
  }
} /* mq 40em */


/*--------------------------------------------------------------
Base styles that apply to all menu items
--------------------------------------------------------------*/
.menu-section {
  padding-bottom: 2em;
  margin-bottom: 2em;
  border-bottom: 1px solid hsl(0, 0%, );
}

.menu ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  background: hsl(0, 0%, 15%);
}

.menu li a {
  display: block;
  text-decoration: none;
  color: white;
  padding: .6em 1em;
}

.menu li a:hover {
  background: hsl(0, 0%, 25%);
}


/* Styles for Single Level Menu */
@media screen and (max-width: 30em){
  .multi-level-nav ul ul li a {
    padding-left: 2em;
  }

  .dropdown-toggle {
    display: none;
  }
}

@media screen and (min-width: 30em){
  .multi-level-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
  } 

  .multi-level-nav li {
        flex: 1 0 auto;
    position: relative;
  }

  li.has-children > a {
    padding-right: 0;
  }

  .multi-level-nav ul ul {
    display: none;
    position: absolute;
    z-index:100;
  }

  .multi-level-nav ul ul li {
        flex: 1 1 auto;
  }

  .multi-level-nav ul .toggled-on {
    display: flex;
  }

  .dropdown-toggle {
    margin: 0;
    padding: 0 .5em;
    border: 0;
    font-family: 'FontAwesome';
    content: "";
    text-transform: lowercase; /* Stop screen readers to read the text as capital letters */
    background-color: transparent;
  }

  .dropdown-toggle:after {
    position: relative;
    top: 0;
    left: 0;
    width: 42px;
    color: white;
    content: "\f107";
    line-height: 1em; 
  }

  .dropdown-toggle:hover,
  .dropdown-toggle:focus {
    background: hsl(0, 0%, 25%);
  }

  .dropdown-toggle.toggle-on:after {
    content: "\f106";
  }
}

/*--------------------------------------------------------------
Styles for social media menu
--------------------------------------------------------------*/
/* Find src URL and add in correct social media icon. */
.social-menu li a:before {
    font-family: 'Fontawesome';
    -webkit-font-smoothing: antialiased;
    content: '\f08e';
}

.social-menu li a[href*="dribbble.com"]::before { content: '\f17d'; }

.social-menu li a[href*="facebook.com"]::before { content: '\f09a'; }

.social-menu li a[href*="flickr.com"]::before { content: '\f16e'; }

.social-menu li a[href*="foursquare.com"]::before { content: '\f180'; }

.social-menu li a[href*="github.com"]::before { content: '\f09b'; }

.social-menu li a[href*="plus.google.com"]::before { content: '\f0d5'; }

.social-menu li a[href*="instagram.com"]::before { content: '\f16d'; }

.social-menu li a[href*="jsfiddle.com"]::before { content: '\f1cc'; }

.social-menu li a[href*="linkedin.com"]::before { content: '\f0e1'; }

.social-menu li a[href*="pinterest.com"]::before { content: '\f0d2'; }

.social-menu li a[href*="reddit.com"]::before { content: '\f1a1'; }

.social-menu li a[href*="soundcloud.com"]::before { content: '\f1be'; }

.social-menu li a[href*="stackoverflow.com"]::before { content: '\f16c'; }

.social-menu li a[href*="tumblr.com"]::before { content: '\f173'; }

.social-menu li a[href*="twitter.com"]::before { content: '\f099'; }

.social-menu li a[href*="vimeo.com"]::before { content: '\f194'; }

.social-menu li a[href*="vine.co"]::before { content: '\f1ca'; }

.social-menu li a[href*="yelp.com"]::before { content: '\f1e9'; }

.social-menu li a[href*="youtube.com"]::before { content: '\f167'; }

.social-menu li a[href*="wordpress.com"]::before { content: '\f19a'; }

/* Flexbox stuff */

.social-menu ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/*--------------------------------------------------------------
Styles for mixed menu (drop-down + social)
--------------------------------------------------------------*/
.nav-mixed {
  background: hsl(0, 0%, 15%);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/*--------------------------------------------------------------
Card Based Layout - Base styles
--------------------------------------------------------------*/
.main-area {
  padding: 2em;
}

.card {
  background: white;
  margin-bottom: 2em; 
}

.card a {
  color: black;
  text-decoration: none;
}

.card a:hover {
  box-shadow: 3px 3px 8px hsl(0, 0%, 70%);
}

.card-content {
  padding: 1.4em;
}

.card-content h2 {
  margin-top: 0;
  margin-bottom: .5em;
  font-weight: normal;
}

.card-content p {
  font-size: 95%;
}

img {
  width: 100%;
  height: auto;
}

/*--------------------------------------------------------------
Flexbox card styles
--------------------------------------------------------------*/
@media screen and (min-width: 40em) {  
  .cards {
    margin-top: -1em;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .card {
    margin-bottom: 1em;
    display: flex;
    flex: 0 1 calc(50% - 0.5em);
    /* width: calc(50% - 1em); */
  }
} /* mq 40em*/

@media screen and (min-width: 60em) {
  .cards {
    margin-top: inherit;
  }
  
  .card {
    margin-bottom: 2em;
    display: flex;
    flex: 0 1 calc(33% - 0.5em);
    /* width: calc(33% - 1em); */
  }
} /* mq 60em*/
              
            
!

JS

              
                (function($) {
	// Drastically modified from the function in the WordPress Twenty Fifteen theme
	// Original source: https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentyfifteen/js/functions.js
	$('.dropdown-toggle').click(function(e) {
		var _this = $(this);
		e.preventDefault();
		_this.toggleClass('toggle-on');
		_this.parent().next('.sub-menu').toggleClass('toggled-on');
		_this.attr('aria-expanded', _this.attr('aria-expanded') === 'false' ? 'true' : 'false');
		_this.html(_this.html() === '<span class="screen-reader-text">Expand child menu</span>' ? '<span class="screen-reader-text">Collapse child menu</span>' : '<span class="screen-reader-text">Expand child menu</span>');
	});

	// sidebar menu
  $('a.sidebar-left-toggle').click(function () {
    if (!$('.sidebar').hasClass('.sidebar-left')) {
      $('.sidebar').addClass('sidebar-left');
    }
  });
  
  $('a.sidebar-right-toggle').click(function () {
    if ($('.sidebar').hasClass('sidebar-left')) {
      $('.sidebar').removeClass('sidebar-left');
    }   
  });
  
  $('a.no-sidebar-toggle').click(function () {
    if (!$('.content').hasClass('no-sidebar')) {
      $('.content').addClass('no-sidebar');
    } else {
      $('.content').removeClass('no-sidebar');
    }
  });
  
  $('a.hide-sidebar-toggle').click(function() {
    if (!$('.sidebar').hasClass('hide')){
      $('.sidebar').addClass('hide');
    } else {
      $('.sidebar').removeClass('hide');  
    }
  });
})(jQuery);
              
            
!
999px

Console