cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

              <div class="container">
  <div class="image-area">
    <div class="overlay"></div>
    <div class="item first">
    <div class="item second">
    <div class="item third">
  <div class="dots"></div>
              .container {
	width: 400px;
	height: 300px;
	position: relative;
	margin: 50px auto;
	/*Set the perspective on the container*/
	perspective: 800;
.container .image-area {
	height: 300px;
	width: 400px;
	opacity: 1;
	/*Rotate the secondary container*/
  transform-style: preserve-3d;
	transform: rotateX(0deg);
	transition: all 1s ease;
.container .image-area.transition {
	opacity: 0.8;
.container .item {
	position: absolute;
	top: 0;
	left: 0;
  height: 300px;
	width: 400px;
  background-size: cover;
  background-position: center;
  backface-visibility: hidden;
.container .item.first {
	transform: rotateX(0deg) translateZ(150px);
  background-image: url('http://assets.worldwildlife.org/photos/2842/images/hero_small/shutterstock_12730534.jpg?1352150501');
.container .item.second {
  transform: rotateX(-90deg) translateZ(150px);
  background-image: url('http://blogs-images.forbes.com/juliewilcox/files/2012/10/fall-leaves-tree.jpg');
.container .item.third {
  transform: rotateX(-180deg) translateZ(150px);
  background-image: url('https://1.bp.blogspot.com/_RAlP3BmEW1Q/TQX5iLmaRxI/AAAAAAAACPo/rlWEYeLOY74/s1600/The-best-top-winter-desktop-wallpapers-7.jpg');
.dot {
	height: 20px;
	width: 20px;
	margin-top: 50px;
	margin-right: 1em;
	border-radius: 50%;
	background-color: black;
	display: inline-block;
	opacity: 0.5;
.dot:hover {
	cursor: pointer;
.dot.current {
	opacity: 1;
              $(function() {
	function createDots(cb) {
		var $slides = $('.image-area .item');
		var slideLength = $slides.length;
		var dotTemp = '<div class="dot"></div>';
		var html = '';
		var $dotContainer = $('.dots');
		for (var i = 0; i < slideLength; i++) {
			html += dotTemp;
	function rotateSlider() {
		var $container = $('.container .image-area');
		var $dot = $('.dots .dot');
		$dot.on('click', function() {
			var index = $dot.index($(this));
			$('.dots .dot').removeClass('current');
			$container.css('transform','rotateX(' + (index * 90) +'deg)');
			$container.on('transitionend', function() {
	createDots(function() {

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................