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

              
                
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Smells Like Bakin' Cupcake Company</title>
  <link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
  <link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
  <link href='https://fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
  
  <script src="external/matchmedia.js"></script>
  <script src="picturefill.js"></script>
  
  <meta name="viewport" content="width=device-width, initial-scale =1.0 user-scalable= no">
  
</head>
<body>
  <div class="container clearfix">
  
    <div class="grid_4">
    <object data="img/logo.svg" type="image/svg+xml" class="chart">
    	<a href="img/logo.svg">
    	<!--[if lte IE8-->
    
      <img src="img/logo.gif" alt="Smells Like Bakin">
      <!--[end if]-->
      </a>
      </object>
      
    </div>
    <div class="grid_8 omega">
      <ul class="nav">
        <li><a href="#">About</a></li>
        <li><a href="#">Cupcakes &amp; Prices</a></li>
        <li><a href="#">Locations</a></li>
        <li class="last"><a href="#">Contact Us</a></li>
      </ul>
    </div>
    <div id="intro" class="grid_9">
      <h1 id="fittext1">Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious desserts.</h1>
      <p><a href="#" class="btn">Browse Our Cupcakes</a></p>
    </div>
    <div class="grid_3 omega">
      <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">
    </div>

    <div id="featured-cupcake" class="grid_7">
      <h2>Cupcake of the Week</h2>
      <p>This week's featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavors will kick your taste buds into fiesta mode!</p>
      
      <div id="featured-video">
      <iframe src="https://player.vimeo.com/video/50610288?title=0&amp;byline=0&amp;portrait=0" width="400" height="270" frameborder="0"></iframe>
      </div>
      </div>
      
      <div data-picture data-alt="Avocado Chocolate Cupcake">
	<div data-src="external/imgs/avocado-small.jpg"></div>
	<div data-src="external/imgs/avocado-medium.jpg"	data-media="(min-width: 400px)"></div>
	<div data-src="external/imgs/avocado-large.jpg"		data=media="(min-width: 800px)"></div>
	<div data-src="external/imgs/avocado-extralarge,jpg"	data-media="(min-width: 1000px)"></div>
	<div data-src="extralarge_x2.jpg"	data-media="(min-width: 1000px) and (min-device-pixel-ratio: 2.0"></div>

	<!-- Fallback content for non JS browsers. Same img as the initial unqualified source element. -->
	<noscript>
		<img src="external/imgs/avocado-small.jpg" alt="Avocado Chocolate Cupcake">
	</noscript>
    </div>

    <div id="new-cupcakes" class="grid_5 omega">
      <h2>Fresh Out the Oven</h2>
      <p>Our newest cupcakes are <a href="#">Bacon Me Crazy</a> and <a href="#">Jalapeño So Spicy</a>. </p>
      
     <div data-picture data-alt="Bacon Me Crazy">
	<div data-src="external/imgs.bacon-small.jpg"></div>
	<div data-src="external/imgs/bacon-medium.jpg"	data-media="(min-width: 400px)"></div>
	<div data-src="external/imgs/bacon-large.jpg"		data=media="(min-width: 800px)"></div>
	<div data-src="external/imgs/bacon-extralarge,jpg"	data-media="(min-width: 1000px)"></div>
	<div data-src="extralarge_x2.jpg"	data-media="(min-width: 1000px) and (min-device-pixel-ratio: 2.0"></div>

	<!-- Fallback content for non JS browsers. Same img as the initial unqualified source element. -->
	<noscript>
		<img src="external/imgs/small.jpg" alt="A giant stone face at The Bayon Temple in Angor Thom, Cambodia">
	</noscript>
    </div>
      
      
      <img src="img/new-cupcake-bacon.jpg" alt="Bacon Me Crazy">
      <img src="img/new-cupcake-jalapeno.jpg" alt="Jalapeno So Spicy">
    </div>


    <div class="grid_7">
      <h2>Inside the Kitchen</h2>
      <p>Smells Like Bakin' started out in the garage of the husband wife duo Allison &amp; Joseph. Allison is the baker, and Joseph found a way for them to make a business out of her tasty treats. Flash forward to today and they have a successful store front, catering business and cupcake truck. </p>
      <p><a href="#" class="btn-small">Read More</a></p>
    </div>

    <div class="grid_5 omega">
      <h2>Get Bakin' with Us</h2>

      <div id="contact">
        <p>Call us: <span>1-555-CUP-CAKE</span><br>
        Email us: <a href="#">bakeon@smellslikebakin.com</a></p>
      </div>


      <p>We announce all of our new flavors first through Facebook &amp; Twitter, and even take requests!</p>
      <a href="https://www.facebook.com/SmellsLikeBakin"><img src="img/facebook.gif" alt="Facebook"></a>
      <a href="https://twitter.com/#!/smellslikebakin"><img src="img/twitter.gif" alt="Twitter"></a>
    </div>

    <div id="copyright" class="grid_12">
      <p>&copy; 2012 Smells Like Bakin' Cupcake Company. All Rights Reserved.</p>
    </div>

  </div>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  <script>
	$(function() {
		causeRepaintsOn = $("h1, h2, h3, p");
		$(window).resize(function() {
			causeRepaintsOn.css("z-index", 1);
	    });
	 });
</script>
  <script src="jquery.fitvids.js"></script>
  <script src="jquery.fittext.js"></script>
  
<script>
		//Target your .container, .wrapper, .post, etc.
		$("#featured-video").fitVids();
</script>  
  
  <script type="text/javascript">
	$("#fittext1").fitText(1);
</script>
  
</body>
</html>
              
            
!

CSS

              
                
body {
	font-family: 'Nunito', sans-serif;
	font-weight: 100;
	font-size: 1.125em;
	color: #faf3bc;
	background: #420600 url('img/bg-texture.jpg') repeat;
}

a {
	color: #4fb69f;
	text-decoration: none;
}

img, object {
	max-width: 100%;
}

/*typography*/

h1 {
	font-size: 1.750em;
	font-size: 2.5vw;
	font-weight: 100;
	letter-spacing: -1.5px;
}

h2 {
	font-weight: 100;
	font-size: 1.500em;
	color: #b4c34f;
}

h3 {
	font-weight: 100;
	font-size: 1.125em;
	color: #ed6c85;
}

/*buttons*/

.btn {
	padding: 15px 30px;
	color: #faf3bc;
	background: #4fb69f url('img/texture.png') no-repeat right top;
	border-radius: 25px;
	-webkit-border-radius: 25px;
	-moz-border-radius: 25px;
	text-transform: uppercase;
}

.btn:hover {
	background-color: #4cc4a7;
}


.btn-small {
	padding: 10px 25px;
	color: #faf3bc;
	font-size: .75em;
	background: #b22316 url('texture.png') no-repeat right bottom;
	border-radius: 25px;
	-webkit-border-radius: 25px;
	-moz-border-radius: 25px;
	text-transform: uppercase;
}

.btn-small:hover {
	background-color: #c62718;
}

/*navigation*/

.nav ul {
	width: 100%;
	margin: 20% 0 0 0;
	list-style: none;
	float: right;
	}
.nav ul li {
	float: left;
	}
	.nav ul li.about {
		width: 15%;
	}
	.nav ul li.pricing {
		width: 35%;
	}
	.nav ul li.locations {
		width: 15%;
	}
	.nav ul li.contact {
		width: 25%;
		margin: 0 5% 0 5%;
		padding: 8px 0;
		color: #faf3bc;
		font-family: 'Nunito', sans-serif;
		text-align: center;
		border: 0;
		font-weight: 100;
		font-size: .75em;
		background: #b22316 url('texture.png') no-repeat right top;;
		border-radius: 25px;
		-webkit-border-radius: 25px;
		-moz-border-radius: 25px;
		text-transform: uppercase;
	}
.nav ul li.contact:hover {
		background-color: #c62718;
	}
.nav ul li a {
	color: #faf3bc;
	display: block;
	text-decoration: none;
	}

/*content*/

.intro {
	margin: 0 0 5% 0;
}

.new-cupcakes img {
	box-sizing: border-box;
	background-color: #faf3bc;
	padding: 8px;
	margin: 0 0 5% 0;
}


.featured-cupcake img {
	box-sizing: border-box;
	background-color: #faf3bc;
	padding: 8px;
	margin: 0 0 5% 0;
}

.contact span{
	color: #b22316;
	font-weight: 600;
}

.copyright {
	border-top: 8px solid #2a0400;
	padding: 2% 0;
	margin: 2% 0;
	text-align: center;
}

/*media queries*/

/* Medium Resolution ----------- */
@media screen and (max-width: 1024px) {


.intro {
	width: 100%; 
}
.intro-img {
	display: none;
}
.intro h1 {
	margin:  0 0 5% 0;
}
.logo {
	width: 100%;
	text-align: center;
}
.logo img {
	max-width: 55%;
}
.nav {
	width: 100%;
}
.nav ul {
	margin: 0;
}

.nav ul li {
	float: left;
	margin: 5% 0 0 0;
	}
	.nav ul li.about {
		width: 15%;
	}
	.nav ul li.pricing {
		width: 35%;
	}
	.nav ul li.locations {
		width: 25%;
	}
	.nav ul li.contact {
		width: 25%;
		margin: 5% 0 2% 0;
	}


}


/* Smaller Resolution ----------- */
@media screen and (max-width : 650px) {

.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11,
.grid_12 {
	width:100%;
}
.logo img {
	max-width: 100%;
}
.nav ul {
	margin: 5% 0;
}

.nav ul li a {
	-webkit-user-select: none;
	font-size: 0.750em;
}

.nav ul li {
	float: left;
	margin: 5% 0;
	}
	.nav ul  li.about {
		width: 20%;
		text-align: left;
	}
	.nav ul  li.pricing {
		width: 55%;
		text-align: center;
	}
	.nav ul  li.locations {
		width: 25%;
		text-align: right;
	}
	.nav ul  li.contact {
		width: 100%;
		margin: 0;
		font-size: 1em;
	}


.intro, .about {
	display: none;
}
.featured-cupcake, .new-cupcakes {
	margin: 5% 0;
}

}
              
            
!

JS

              
                /*global jQuery */
/*jshint multistr:true browser:true */
/*!
* FitVids 1.0.3
*
* Copyright 2013, Chris Coyier - https://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
* Date: Thu Sept 01 18:00:00 2011 -0500
*/

(function( $ ){

  "use strict";

  $.fn.fitVids = function( options ) {
    var settings = {
      customSelector: null
    };

    if(!document.getElementById('fit-vids-style')) {

      var div = document.createElement('div'),
          ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
          cssStyles = '&shy;<style>.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>';

      div.className = 'fit-vids-style';
      div.id = 'fit-vids-style';
      div.style.display = 'none';
      div.innerHTML = cssStyles;

      ref.parentNode.insertBefore(div,ref);

    }

    if ( options ) {
      $.extend( settings, options );
    }

    return this.each(function(){
      var selectors = [
        "iframe[src*='player.vimeo.com']",
        "iframe[src*='youtube.com']",
        "iframe[src*='youtube-nocookie.com']",
        "iframe[src*='kickstarter.com'][src*='video.html']",
        "object",
        "embed"
      ];

      if (settings.customSelector) {
        selectors.push(settings.customSelector);
      }

      var $allVideos = $(this).find(selectors.join(','));
      $allVideos = $allVideos.not("object object"); // SwfObj conflict patch

      $allVideos.each(function(){
        var $this = $(this);
        if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
        var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
            width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
            aspectRatio = height / width;
        if(!$this.attr('id')){
          var videoID = 'fitvid' + Math.floor(Math.random()*999999);
          $this.attr('id', videoID);
        }
        $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
        $this.removeAttr('height').removeAttr('width');
      });
    });
  };
// Works with either jQuery or Zepto
})( window.jQuery || window.Zepto );

              
            
!
999px

Console