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

              
                <section class="shelf">
  <div>
    <!-- Blu ray case preview -->
    <article class="bluray case">
      <div>
        <div class="logo"><img src="http://cases.tb-one.se/img/bluray.png"></div>

        <div class="img">
          <span><!-- YOUR IMAGE HERE --></span>
        </div>
      </div>
    </article>

    <!-- Playstation 3 case preview -->
    <article class="ps3 case">
      <div>
        <div class="logo">
          <img src="http://cases.tb-one.se/img/bluray-ps3.png">
          <img src="http://cases.tb-one.se/img/ps3.png">
        </div>
        <div class="img">
          <span><!-- YOUR IMAGE HERE --></span>
        </div>
      </div>
    </article>

    <!-- Xbox 360 case preview -->
    <article class="xbox case">
      <div>
        <div class="img">
          <span><!-- YOUR IMAGE HERE --></span>
        </div>
      </div>
    </article>

    <!-- CD case preview -->
    <article class="cd case">
      <div>
        <div class="img">
          <span><!-- YOUR IMAGE HERE --></span>
        </div>
      </div>
    </article>
  </div>
</section>
<section class="shelf">
  <div>
    <!-- Blu ray case preview -->
    <article class="bluray case">
      <div>
        <div class="logo"><img src="http://cases.tb-one.se/img/bluray.png"></div>

        <div class="img">
          <span><img src="https://upload.wikimedia.org/wikipedia/en/thumb/6/65/Clerks_movie_poster%3B_Just_because_they_serve_you_---_.jpg/215px-Clerks_movie_poster%3B_Just_because_they_serve_you_---_.jpg"</span>
        </div>
      </div>
    </article>

    <!-- Playstation 3 case preview -->
    <article class="ps3 case">
      <div>
        <div class="logo">
          <img src="http://cases.tb-one.se/img/bluray-ps3.png">
          <img src="http://cases.tb-one.se/img/ps3.png">
        </div>
        <div class="img">
          <span><img src="http://upload.wikimedia.org/wikipedia/en/thumb/5/51/FIFA_13_Global_Cover.jpeg/250px-FIFA_13_Global_Cover.jpeg"></span>
        </div>
      </div>
    </article>

    <!-- Xbox 360 case preview -->
    <article class="xbox case">
      <div>
        <div class="img">
          <span><img src="http://www.gamereactor.se/media/93/nhl13_549331b.jpg"></span>
        </div>
      </div>
    </article>

    <!-- CD case preview -->
    <article class="cd case">
      <div>
        <div class="img">
          <span><img src="http://upload.wikimedia.org/wikipedia/en/thumb/8/8f/2pacalypse_now.jpg/220px-2pacalypse_now.jpg"></span>
        </div>
      </div>
    </article>
  </div>
</section>
              
            
!

CSS

              
                /* Preview styling only
------------------------ */

body {
	background: #f6f5ee repeat;
}

article {
	margin: 0 10px;
}

/* The awesome
------------------ */

/* Shelf (Works best in Webkit) */
.shelf {
	position: relative;
	width: 721px;
	border-bottom: 13px solid #24252a;
	text-align: center;
	padding: 0 27px;
  margin: 20px auto;
  background: transparent;
}

.shelf:after {
	position: absolute;
	bottom: -13px;
	left: 34px;
	height: 10px;
	background: transparent;
	content: "";
	-webkit-transform: perspective( 150 ) rotateX( -25deg );
	   -moz-transform: perspective( 150 ) rotateX( -25deg );
	    -ms-transform: perspective( 150 ) rotateX( -25deg );
	        transform: perspective( 150 ) rotateX( -25deg );
	right: 34px;
	box-shadow: 0 0 17px 5px rgba(0, 0, 0, 0.7);
	z-index: -1;
}

	.shelf > div {
		border-bottom: 23px solid #303138;
		position: relative;
		z-index: 1;
	}
	
	.shelf > div:before {
	  content: '';
	  width: 0px;
	  height: 0px;
	  border-style: solid;
	  border-width: 0 0 23px 27px;
	  border-color: transparent transparent #303138 transparent;
	  position: absolute;
	  bottom: -23px;
	  left: -27px;
	  z-index: 2;
	  -webkit-transform:rotate(360deg);
	  -moz-transform:rotate(360deg);
	  transform:rotate(360deg);
	}
	
	.shelf > div:after {
	  content: '';
	  width: 0px;
	  height: 0px;
	  border-style: solid;
	  border-width: 23px 0 0 27px;
	  border-color: transparent transparent transparent #303138;
	  position: absolute;
	  bottom: -23px;
	  right: -27px;
	  z-index: 2;
	}
	
		.shelf > div > * {
			position: relative;
			z-index: 2;
			top: 18px;
		}


/* Default case template (Bluray) */

.case {
	display: inline-block;
	width: 142px;
	height: 179px;
	border-radius: 5px;
	position: relative;
	z-index: 1;
}

.case:after {
	width: 100%;
	height: 10px;
	border-radius: 20px;
	content: "";
	background: rgba(0, 0, 0, 0.3);
	position: absolute;
	bottom: -5px;
	-webkit-transform: perspective(600) rotateX(100deg);
	   -moz-transform: perspective(600) rotateX(100deg);
	    -ms-transform: perspective(600) rotateX(100deg);
	     -o-transform: perspective(600) rotateX(100deg);
	        transform: perspective(600) rotateX(100deg);
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
	left: 0;
}

	.case > div {
		width: 100%;
		height: 100%;
		background: #46b0e9;
		background: rgba(70, 176, 233, 0.8);
		border-radius: 8px 8px 5px 5px;
		-webkit-box-sizing: border-box;
		   -moz-box-sizing: border-box;
		        box-sizing: border-box;
		padding: 14px 3px 3px 0;
		overflow: hidden;
		position: relative;
	}
	
	.case > div:after {
		content: "";
		position: absolute;
		top: 0;
		left: 35px;
		width: 100%;
		height: 200%;
		background: rgba(255, 255, 255, 0.2);
		z-index: 10;
		-webkit-transform: rotate(30deg);
		   -moz-transform: rotate(30deg);
		    -ms-transform: rotate(30deg);
		     -o-transform: rotate(30deg);
		        transform: rotate(30deg);
	}
	
		.case > div > .logo {
			position: absolute;
			top: 5px;
			left: 0;
			width: 100%;
		}
		
			.case > div > .logo > img {
				max-height: 8px;
				width: auto;
				margin: auto;
				display: block;
			}
	
		.case > div > .img {
			-webkit-box-sizing: border-box;
			   -moz-box-sizing: border-box;
			        box-sizing: border-box;
			width: 100%;
			height: 100%;
			padding: 1px 1px 1px 0;
			border-radius: 0 4px 4px 0;
			background: rgba(0, 0, 0, 0.2);
			position: relative;
		}
		
		.case > div > .img:before {
			content: "";
			position: absolute;
			top: -10px;
			left: 1px;
			width: 2px;
			bottom: 0;
			background: rgba(255, 255, 255, 0.3);
			border-radius: 8px;
			z-index: 3;
		}
		
		.case > div > .img:after {
			content: "";
			position: absolute;
			top: -13px;
			left: 1px;
			right: -2px;
			height: 15px;
			border-top: 2px solid rgba(255, 255, 255, 0.3);
			border-radius: 8px;
		}
		
			.case > div > .img > span {
				-webkit-box-sizing: border-box;
				   -moz-box-sizing: border-box;
				        box-sizing: border-box;
				width: 100%;
				height: 100%;
				padding: 1px 1px 1px 0;
				border-radius: 0 4px 4px 0;
				background: rgba(255, 255, 255, 0.2);
				display: block;
				position: relative;
			}
			
			.case > div > .img > span:before {
				position: absolute;
				top: 2px;
				left: 0;
				width: 0;
				height: 100%;
				content: "";
				box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.3);
				z-index: 2;
			}
			
			.case > div > .img > span:after {
				position: absolute;
				top: 5px;
				left: 0;
				width: 0;
				height: 100%;
				content: "";
				box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.3);
				z-index: 1;
			}
			
				.case > div > .img > span > img {
					width: 100%;
					height: 100%;
					display: block;
					border-radius: 0 3px 3px 0;
				}

				
/* PS3 */
.case.ps3 > div {
	background: #fff;
	background: rgba(239, 239, 239, 0.8);
}

	.case.ps3 > div > .logo {
		text-align: left;
		overflow: hidden;
	}
	
		.case.ps3 > div > .logo > img {
			float: left;
			margin-left: 10px;
		}
		
		.case.ps3 > div > .logo > img + img {
			float: right;
			margin-right: 7px;
			max-height: 3px;
			margin-top: 2px;
		}
		
/* XBOX 360 */
.case.xbox {
	height: 203px;
}

.case.xbox > div {
	background: #75bb24;
	background: rgba(117, 187, 36, 0.8);
	padding: 3px 3px 3px 0;
	border-radius: 2px 5px 5px 2px;
}

/* CD */
.case.cd {
	height: 131px;
}

.case.cd > div {
	background: #fff;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 0;
	padding: 1px 1px 1px 13px;
	border: 1px solid rgba(0, 0, 0, 0.6);
}

	.case.cd > div > .img {
		border-radius: 0;
		padding: 0;
		border: 1px solid rgba(0, 0, 0, 0.6);
	}
	
	.case.cd > div > .img:after,
	.case.cd > div > .img > span:before,
	.case.cd > div > .img > span:after {
		display: none;
	}
	
	.case.cd > div > .img:before {
		box-shadow: none;
		width: 12px;
		background-color: #444;
		background-image: -webkit-gradient(linear, 0 0, 100% 0, color-stop(.5, rgba(0, 0, 0, .2)), color-stop(.5, transparent), to(transparent));
		background-image: -webkit-linear-gradient(0deg, rgba(0, 0, 0, .2) 50%, transparent 50%, transparent);
		background-image: -moz-linear-gradient(0deg, rgba(0, 0, 0, .2) 50%, transparent 50%, transparent);
		background-image: -ms-linear-gradient(0deg, rgba(0, 0, 0, .2) 50%, transparent 50%, transparent);
		background-image: -o-linear-gradient(0deg, rgba(0, 0, 0, .2) 50%, transparent 50%, transparent);
		background-image: linear-gradient(0deg, rgba(0, 0, 0, .2) 50%, transparent 50%, transparent);
		border-radius: 0;
		background-size: 2px 100%;
		top: -1px;
		bottom: -1px;
		left: -14px;
	}
	
		.case.cd > div > .img > span {
			background: transparent;
		}
		
			.case.cd > div > .img > span > img {
				border-radius: 0;
			}
              
            
!

JS

              
                
              
            
!
999px

Console