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

              
                <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" />
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<nav class="nav">
  <button class="btn-toggle" onclick="$(this).parents('body').toggleClass('drawer-open')"></button>
  <div class="profile">
    <img src="https://source.unsplash.com/200x200/?face,woman" />
    <div>
      <h2>James Bond</h2>
      <p>Master Chef</p>
    </div>
  </div>
  <ul class="menu">
    <li class="active"><a href="#"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="#"><i class="fa fa-book"></i> Catalog</a></li>
    <li><a href="#"><i class="fa fa-tasks"></i> Tasks</a></li>
    <li><a href="#"><i class="fa fa-calculator"></i> Calculator</a></li>
  </ul>
  <div class="overlay"></div>
</nav>
<section class="container">
  <div class="block">
    <div class="image" style="background-image:url('https://source.unsplash.com/800x400/?food,pasta')"></div>
    <div class="content">
      <h2><a href="#">How all this mistaken idea of denouncing pleasure and praising pain?</a></h2>
      <p>
        But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human
        happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves
        or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical
        exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?
      </p>
    </div>
  </div>
  <div class="block">
    <div class="image" style="background-image:url('https://source.unsplash.com/800x400/?food,pizza')"></div>
    <div class="content">
      <h2><a href="#">How all this mistaken idea of denouncing pleasure and praising pain?</a></h2>
      <p>
        But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human
        happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves
        or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical
        exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?
      </p>
    </div>
  </div>
</section>
              
            
!

CSS

              
                @import "lesshat";

@drawer-width:200px;
@drawer-border-color:rgba(0,0,0,0.7);
@content-blur:2px;
@content-opacity:0.2;
@speed:0.1s;
@default-spacing:30px;
body{
	font-family: 'Roboto', Arial, sans-serif;
	background:#f3f3f3;
	font-size: 14px;
	font-weight: 300;
	line-height: 150%;
	overflow-x: hidden;
}
h1,h2,h3,h4,h5{
	font-family: 'Roboto Condensed', Arial, sans-serif;
	font-weight: 400;
}
section.container{
	max-width:600px;
  transform-origin: 100% 0%;
	width:100%;
	box-sizing: border-box;
	padding:0 @default-spacing;
	padding-bottom: 80px;
	transition: all @speed ease-in-out;
	margin:0 auto;
}
nav.nav{
	transition: all @speed ease-in-out;
	display: block;
	z-index: 1000;
	background:#223;
	color:#fff;
	width:@drawer-width;
	position: fixed;
	top:0;
	left:-@drawer-width;
	bottom:0;
	.overlay{
		display: none;
		position: fixed;
		top:0;
		left:0;
		bottom:0;
		width:100%;
		z-index: -1;
		background:rgba(0,0,0,0.2);
	}
	.btn-toggle{
		transition: all @speed ease-in-out;
		position:absolute;
		right:calc(-100% + 20px);
		border:none;
		display: block;
		background: inherit;
		bottom:20px;
		padding:0 20px;
		margin:0;
		height:50px;
		//width:50px;
		line-height:50px;
		border-radius:100px;
		color:#fff;
		outline:none;
		box-shadow:rgba(0,0,0,0.5) 0 2px 4px -2px;
		&:before{
			font-family:'FontAwesome';
			content:'\f0c9';
			display: inline-block;
		}
    &:after{
      content:'Menu';
      display:inline-block;
      margin-left:10px;
    }
	}
	.profile{
		padding:@default-spacing;
		border-bottom: 1px solid @drawer-border-color;
		img{
			height:40px;
			width:40px;
			border-radius: 80px;
			float:left;
			margin-right: @default-spacing;
			&+div{
				overflow: hidden;
			}
		}
		>div{
			padding-top:7px;
			h2, p{
				margin:0;
				padding: 0;
			}
			h2{
				font-size:1.2em;
			}
			p{
				color:#99a;
				font-size: 0.8em;
			}
		}
	}
	.menu{
		margin:0;padding:0;
		list-style:none;
		border-bottom: 1px solid @drawer-border-color;
		>li{
			margin:0;padding:0;
			>a{
				padding:@default-spacing/2 @default-spacing;
				display: block;
				color:inherit;
				text-decoration: none;
				color:#99a;
			}
		}
		>li.active{
			a{
				border-right:4px solid #fff;
				color:#fff;
			}
		}
	}
	.search{
		border-bottom: 1px solid @drawer-border-color;
		input{
			display: block;
			box-sizing: border-box;
			width: 100%;
			padding:@default-spacing;
			border:none;
			background:transparent;
		}
	}
}
.block{
	margin:@default-spacing 0;
	background: #fff;
	box-shadow: rgba(0,0,0,0.3) 0 2px 4px -2px;
	>.content{
		padding:@default-spacing;
		h2 a{
			color:inherit;
			text-decoration: none;
		}
	}
	.image{
		height:50vmin;
		max-height: 240px;
		background-size: cover;
		background-position: center center;
	}
}
body.drawer-open{
	background:#ddd;
	nav.nav{
		box-shadow: rgba(0,0,0,0.3) 2px 0 4px;
		left:0;
		.overlay{
			display: block;
		}
		&+section.container{
			//margin-left: @drawer-width;
      filter:blur(2px);
			opacity: @content-opacity;
		}
		.btn-toggle{
			right:20px;
			background:#fff;
			color:#000;
			&:before{
				content:'\f00d';
			}
      &:after{
        content:'Close';
      }
		}
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console