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

              
                   <div class="container">
        <header class="page-header cf">
            <div class="logo">
                <img src="https://dummyimage.com/150" alt="placeholder logo">
            </div>
            <h1>My Site Title</h1>
        </header>

        <!--    NAVIGATION-->
<div class="menu"> <a href="#" id="menu_button">Menu</a> </div>
        
     <nav id="main_nav" role="navigation">
            <ul>
                <li><a href="index.html">Home</a></li>
                <li><a href="retrieval.html">Retrieval Practice</a></li>
                <li><a href="spaced.html">Spaced Practice</a></li>
                <li><a href="elaboration.html">Elaboration</a></li>
                <li><a href="interleaving.html">Interleaving</a></li>
                <li><a href="concrete.html">Concrete Examples</a></li>
                <li><a href="dualcoding.html">Dual Coding</a></li>
                <li><a href="about.html">About</a></li>
            </ul>
        </nav>
        <!--end main_nav -->
     
<main class="main-content">
          <!-- Dummy Content -->
          <p>When using this you may need to change the breakpoint when the nav changes. Remember both to change it in the CSS @media query and in the JavaScript in the doneResizing() function </p>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum explicabo officia cumque, alias obcaecati natus, praesentium sapiente, eius blanditiis totam eaque molestiae consequatur? Nemo facere, doloribus iure commodi perspiciatis praesentium.</p>
  
     <p><img src="http://placehold.it/800x800" alt="dummy image" /></p>
   <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum explicabo officia cumque, alias obcaecati natus, praesentium sapiente, eius blanditiis totam eaque molestiae consequatur? Nemo facere, doloribus iure commodi perspiciatis praesentium.</p>
  </main>
        <footer>
            <p>&copy; Chris Stein 2018</p>
        </footer>
    </div>

              
            
!

CSS

              
                /* ============================
* Clearfix
* Modified from: http://nicolasgallagher.com/micro-clearfix-hack/
* If you already have a clearfix then you can ignore this.
* =============================*/

/**
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    contenteditable attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that are clearfixed.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */
.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
  clear: both;
}

.cf:after {
    clear: both;
}

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.cf {
    *zoom: 1;
}
/* ============================
* NAVIGATION
* Modified from: http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/a-simple-responsive-mobile-first-navigation/
* =============================*/
#main_nav {
  clear: both;
  display: none;
  /*hidden to start */
}

#main_nav ul {
  list-style: none;
  line-height: 1;
  margin: 0;
  padding: 0;
}

#main_nav li {
  margin-bottom: 0;
}

#main_nav li a {
  display: block;
  color: #fff;
  background-color: #555;
  text-transform: uppercase;
  padding: 0.625em;
  /* 10px in ems is 10/16 */
  text-decoration: none;
  border-bottom: 1px solid #eee;
  font-weight: 900;
}

#main_nav li a:hover {
  color: #555;
  background-color: #fff;
}

#main_nav li a:active {
  color: #555;
  background-color: #f90;
}

/* menu button */
.menu {
  margin-top: 1em;
  margin-bottom: 1em;
}

.menu a {
/*   padding: 0.5em 0.625em; */
  background-color: #555;
  border-radius: 5px;
  color: #fff;
  text-decoration: none;
}

.menu a:hover {
  color: #555;
  background-color: #f90;
}

/* menu button */
.menu {
    margin-top: 1em;
    margin-bottom: 1em;
}

.menu a {
    padding: 0.5em 0.625em;
    background-color: #555;
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
}

.menu a:hover {
    color: #555;
    background-color: #f90;
}


/* ==========================
*  Media Queries for Main Nav
*  ========================== */


/* these don't have to be separate. We did so for two reasons:
1. Easy to copy and paste this into new design
2. Depending on your site you may need separate break points for the nav. You may want to see what width is needed to fit your nav horizontally without breaking and use that as the breakpoint. 
It should also be noted that there is only one media query because this CSS moves the nav to the top where it can stay for all of the other sizes.
*/

@media (min-width: 1205px) {
    /* hide the menu button */
    .menu {
        display: none;
    }
    #main_nav {
        width: 100%;
        display: block;
        overflow: hidden;
        /* should be the same as #main_nav li a background color above */
        background-color: #555;
    }
    #main_nav li {
        display: inline;
        line-height: 1em;
    }
    #main_nav li a {
        float: left;
        padding: 0.9375em;
        /* 10/16  and  15/16 */
        border-bottom: none;
    }
    #main_nav li a.top {
        display: none;
    }

    #footer_nav {
        background-color: #fff;
    }
}



/* 
  ====================================
   These styles are page specific and you would need to change depending on how your page is laid out.
  ====================================
*/
/* responsive images */
img, video{
  width: auto;
  height: auto;
  max-width: 100%;
}
/* border-box model */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

.page-header .logo{
  float:left;
  width: 25%;
}
.page-header h1{
  float: left;
  padding-left: 1em;
  width: 70%;
  /* set this to the height of your image if you ahve one */
  line-height: 150px;
  margin:0;
  padding: 0;
}

 .menu{
  clear: both;
}
              
            
!

JS

              
                jQuery(document).ready(function ($) {
            // Your jQuery code here, using $ to refer to jQuery.
            /* 
               This is the code to slide the main navigation up and down.
            */
            $('#menu_button').click(function (evt) {
                console.log('evt', evt);
                evt.preventDefault();
                $('#main_nav').slideToggle();
            }); //end menu_button
            //this code taken from Sebastien on Stackoverflow: http://stackoverflow.com/questions/6461300/triggering-jquery-with-css-media-queries
            //it's been rearranged slightly
            //leave the lines below and then write your code in the doneResizing function below
            doneResizing();
            var id;
            $(window).resize(function () {
                clearTimeout(id);
                id = setTimeout(doneResizing, 0);
            });

            function doneResizing() {
                //this code requires that you have Modernizr included BEFORE this file. Here is modernizr: https://modernizr.com/
                //the trick with min-width media queries is that you need to start from your largest and go down. In the else at the end you can write  js for any size below your smallest min-width.
                if (Modernizr.mq('screen and (min-width:1205px)')) {
                    $('#main_nav').show(); //make sure it is showing at larger sizes
                }
                else {
                    //Your code goes here for screens below 1205px in this example. 
                    $('#main_nav').hide(); //make sure hiding at smaller sizes
                }
              console.log('resized');
            } //end doneResizing
        });
              
            
!
999px

Console