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

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

              
                
  <html>
    <head>
      <meta charset="utf-8">
      <title>Just For Fun</title>
      <link rel="stylesheet" type="text/css" href="css/normalize.css">
      <link rel="stylesheet" type="text/css" href="css/style.css">
      <meta name="viewport" content="width=device-width, initial-scale= 1">
      <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <!--[if lt IE 9]>
        <script src="files/html5shiv.js"></script>
      <![endif]-->
      <script>
        $(document).ready(function(){
          $("#nav-mobile").html($("#nav-main").html());
          $("#nav-trigger span").click(function(){
            if ($("nav#nav-mobile ul").hasClass("expanded")) {
                $("nav#nav-mobile ul.expanded").removeClass("expanded").slideUp(250);
                $(this).removeClass("open");
           } else {
              $("nav#nav-mobile ul").addClass("expanded").slideDown(250);
              $(this).addClass("open");
           }
        });
      });
      </script>
    </head>
    <body>
      <div class="wrapper">
        <header role="banner">
          <h1>For Fun!</h1>
          <nav id="nav-main">
          	<ul>
              <li><a href="index.html">Home</a></li>
              <li><a href="#">About</a></li>
              <li><a href="#">Pictures</a></li>
              <li><a href="#">Contact</a></li>
           </ul>
          </nav>
          <div id="nav-trigger">
            <span>Menu</span>
          </div>
          <nav id="nav-mobile"></nav>
        </header>
        <article class="col-1">
          <h4>Here We Go</h4>
          <p>In cursus ullamcorper mauris quis finibus. Aliquam dictum efficitur nulla sit amet imperdiet. Pellentesque eu rutrum orci. Donec suscipit ipsum urna, eget sagittis dolor rutrum sed. Curabitur imperdiet massa lorem, eget vestibulum urna malesuada at. Donec sit amet dolor a massa rhoncus tincidunt. Mauris a euismod felis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Maecenas elementum tincidunt odio, vel posuere nisi ultricies eu. Vestibulum malesuada elementum purus, ac tempor tellus semper eget. Donec et consectetur sapien, sed accumsan odio. </p>
        </article>
        <aside class="col-2" role="complementary">
          <h4>Extra Fun</h4>
          <p>Phasellus mi mi, finibus ut suscipit sit amet, consectetur nec ex. Donec consequat erat diam, vitae interdum nulla varius sit amet. In in mauris et velit euismod viverra. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum finibus velit luctus enim tempus varius. Morbi ac magna scelerisque, gravida augue id, condimentum sem. Ut mollis a lorem quis efficitur. Proin fermentum dui et lorem tempus, id posuere metus egestas. Cras ornare, elit et posuere sagittis, orci urna commodo neque, ac rutrum enim ante vel orci. Ut feugiat porta condimentum. Nam varius lectus vel magna interdum, at auctor dui sagittis. Etiam magna quam, tempus sed quam sit amet, accumsan faucibus augue. </p>
        </aside>
        <footer role="contentinfo">
          <p>Just For Fun Design &copy; 2015</p>
        </footer>
      </div>
    </body>
  </html>​
              
            
!

CSS

              
                /*
========================
Box-sizing rule
========================
*/

*, *:before, *:after {
  box-sizing: border-box;
}

/*
=====================
Adding various styles 
to the element tags
=====================
*/

header,
article,
aside,
footer {
	border: 1px solid black;
	padding: 10px 1em;
	margin: 0 5% 10px;
}

header {
	margin-top: 10px;
}

/*
==============================
Centering the page
==============================
*/

.wrapper {
	max-width: 60em;
	margin: 0 auto;
}

/*
============================
Adding styles to the nav
to make the nav mobile 
first responsive.
============================
*/

#nav-trigger {
	display: none;
	text-align: center;
}

#nav-trigger span {
	display: inline-block;
	padding: 0.625em 1.875em;
	background-color: #194775;
	color: white;
	cursor: pointer;
	text-transform: uppercase;
}

#nav-trigger span:after {
	display: inline-block;
	margin-left: 0.625em;
	width: 1.25em;
	height: 0.625em;
	content: "";
	border-left: solid 10px transparent;
	border-top: solid 10px #fff;
	border-right: solid 10px transparent;
}

#nav-trigger span:hover {
	background-color: #335C85;
}

#nav-trigger span.open:after {
	border-left: solid 10px transparent;
	border-top: none;
	border-bottom: solid 10px #fff;
	border-right: solid 10px transparent;
}

nav {
	margin-bottom: 1.875em;
}

nav#nav-main {
	background-color: #003366;
	padding: 0.625em 0;
}

nav#nav-main ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	text-align: center;
}

nav#nav-main li {
	display: inline-block;
	border-right: solid 1px #FFF;
	padding: 0 0.3125em;
}

nav#nav-main li:last-child {
	border-right: none;
}

nav#nav-main a {
	display: block;
	color: white;
	padding: 0.625em 1.875em;
}

nav#nav-main a:visited {
	color: green;
}

nav#nav-main a:hover {
	background-color: #335C85;
	color: #000;
}

nav#nav-main a:active {
	color: yellow;
}

nav#nav-mobile {
	position: relative;
	display: none;
}

nav#nav-mobile ul {
	display: none;
	list-style-type: none;
	position: absolute;
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
	background: #4D7094;
  padding: 0;
}

nav#nav-mobile li {
	display: block;
	padding: 0.3125em 0;
	margin: 0 0.3125em;
	border-bottom: solid 1px #000;
}

nav#nav-mobile a {
	display: block;
	color: white;
	padding: 0.625em 1.875em;
}

nav#nav-mobile a:hover {
	background-color: #002952;
	color: #fff; 
}

/*
=============================
Not sure why but, I have to
add nav ul to make the drop
down links center perfectully
in the downlist.
*/

/*nav ul {
	margin: 0;
	padding: 0;
}*/

/*
============================
MEDIA QUERIES
============================
*/

@media all and (min-width: 11.6875em) and (max-width: 37.5em ) {
	#nav-trigger {
		display: block;
	}
	nav#nav-main {
		display: none;
	}
	nav#nav-mobile {
		display: block;
	}
}





















































              
            
!

JS

              
                
              
            
!
999px

Console