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

              
                <h1>100% CSS Responsive Matryoshka Dolls</h1>
<p>Resize browser width</p>
<p class="footer"><a href="http://www.jimmywarwick.com/playground/russiandoll.html" target="_blank">Full-sized version</a></p>
<!-- doll 1 -->
<div class="doll master">
		<!-- doll 2 -->
		<div class="doll child1">
			<!-- doll 3 -->
			<div class="doll child2">
				<!-- doll 4 -->
				<div class="doll child3">
					<!-- doll 5 -->
					<div class="doll child3">
						<!-- doll 6 -->
						<div class="doll child3">


							<div class="head">
								<div class="face">
									<div class="eye left"></div>
									<div class="eye right"></div>
									<div class="nose"></div>
									<div class="mouth"></div>
									<div class="hair"></div>
								</div>
							</div>
							<div class="body">
								<div class="arm left"></div>
								<div class="arm right"></div>
							</div>
						</div>

						<div class="head">
							<div class="face">
								<div class="eye left"></div>
								<div class="eye right"></div>
								<div class="nose"></div>
								<div class="mouth"></div>
								<div class="hair"></div>
							</div>
						</div>
						<div class="body">
							<div class="arm left"></div>
							<div class="arm right"></div>
						</div>
					</div>

					<div class="head">
						<div class="face">
							<div class="eye left"></div>
							<div class="eye right"></div>
							<div class="nose"></div>
							<div class="mouth"></div>
							<div class="hair"></div>
						</div>
					</div>
					<div class="body">
						<div class="arm left"></div>
						<div class="arm right"></div>
					</div>
				</div>

				<div class="head">
					<div class="face">
						<div class="eye left"></div>
						<div class="eye right"></div>
						<div class="nose"></div>
						<div class="mouth"></div>
						<div class="hair"></div>
					</div>
				</div>
				<div class="body">
					<div class="arm left"></div>
					<div class="arm right"></div>
				</div>
			</div>

			<div class="head">
				<div class="face">
					<div class="eye left"></div>
					<div class="eye right"></div>
					<div class="nose"></div>
					<div class="mouth"></div>
					<div class="hair"></div>
				</div>
			</div>
			<div class="body">
				<div class="arm left"></div>
				<div class="arm right"></div>
			</div>
		</div>

	<div class="head">
		<div class="face">
			<div class="eye left"></div>
			<div class="eye right"></div>
			<div class="nose"></div>
			<div class="mouth"></div>
			<div class="hair"></div>
		</div>
	</div>
	<div class="body">
		<div class="arm left"></div>
		<div class="arm right"></div>
	</div>
</div>
              
            
!

CSS

              
                body {
  background: #fff2f3;
  background: -webkit-radial-gradient(circle, #fff2f3, #FFEDEE);
  font-size: .5em;
}
h1 {
	font: normal 28px Georgia, "Times New Roman", Times, serif;
}

p {
	color: #666;
	font: normal 18px/24px Georgia, "Times New Roman", Times, serif;
}

h1,
p {
	margin: 0;
	padding: 0;
	text-align: center;
	width: 300px;
}

.footer {
  bottom: 8px;
  left: 8px;
  position: fixed;
  text-align: left;
}

.footer a {
  color: #999;
}
/* transition definitions */
.doll {
	-webkit-backface-visibility: hidden;
	-webkit-transform: translate3d(0,0,0);
	-moz-transition: all .5s;
	-ms-transition: all .5s;
	-o-transition: all .5s;
	-webkit-transition: all .5s;
	transition: all .5s;
}

.head {
	-moz-transition: -moz-transform .5s;
	-ms-transition: -ms-transform .5s;
	-o-transition: -o-transform .5s;
	-webkit-transition: -webkit-transform .5s;
	transition: transform .5s;
	-moz-transform-origin: .5em .35em;
	-ms-transform-origin: .5em .35em;
	-o-transform-origin: .5em .35em;
	-webkit-transform-origin: .5em .35em;
	transform-origin: .5em .35em;
}

/*--------------------
	general doll styles
	-------------------- */
.doll {
	bottom: .1em;
	height: 1em;
	margin-left: -.25em;
	position: absolute;
	width: .5em;
	z-index: -1;
}

.master.doll {
	font-size: 30em;
	/*left: 50%;*/
}

.doll .doll {
	font-size: .6em;
	left: -.7em;
}

/* head hole */
.doll::before {
	background: #421b13;
	border-radius: 50%;
	content: '';
	display: block;
	height: .05em;
	left: 50%;
	margin-left: -.19em;
	position: relative;
	top: 0.39em;
	width: 0.38em;
	z-index: -1;
}

/* doll shadow */
.doll::after {
	background: rgba(0, 0, 0, .3);
	border-radius: 50%;
	content: '';
	display: block;
	height: 0.16em;
	left: 50%;
	margin-left: -.35em;
	position: relative;
	bottom: 0.15em;
	width: 0.7em;
	z-index: -1;
}

.head {
	background: #c72f43;
	border-top-left-radius: 45%;
	border-top-right-radius: 45%;
	border-bottom-left-radius: 50% 10%;
	border-bottom-right-radius: 50% 10%;
	box-shadow: 0 .005em 0 rgba(0,0,0,.4);
	height: .3em;
	left: 50%;
	margin-left: -.2em;
	padding: .05em;
	position: relative;
	width: .3em;
	z-index: 2;
}

.face {
	background: #efdfab;
	border-radius: 50%;
	height: .3em;
	overflow: hidden;
	position: relative;
	width: .3em;
}

.hair {
	background: #805937;
	border-radius: 50%;
	height: .3em;
	margin: -.2em 0 0 -.13em;
	position: absolute;
	width: .3em;
}

.hair::after {
	background: #805937;
	border-radius: 50%;
	content: '';
	display: block;
	height: .3em;
	margin: 0 0 0 .26em;
	width: .3em;
}

.eye {
	background: white;
	border-radius: 50% / 60% 60% 30% 30%;
	height: .05em;
	left: 50%;
	margin-top: -.03em;
	position: absolute;
	top: 50%;
	width: .07em;
}

/* eyebrows */
.eye::before {
	border-top: .005em solid #805937;
	border-radius: 50%;
	content: '';
	display: block;
	height: .05em;
	left: 50%;
	margin: -.02em 0 0 -.005em;
	top: 50%;
	width: .08em;
}

/* pupil */
.eye::after {
	background: #421b13;
	border: .0068em solid #4bcfe3;
	border-radius: 50%;
	content: '';
	display: block;
	height: .036em;
	left: 50%;
	margin: 0 0 0 -.0248em;
	position: absolute;
	top: 0;
	width: .036em;
}

.left.eye {
	margin-left: -.09em;
}

.right.eye {
	margin-left: .03em;
}

.nose {
	border-top: .005em solid #ead393;
	border-radius: 50% / 70% 70% 30% 30%;
	height: .02em;
	left: 50%;
	margin: .02em 0 0 -.015em;
	position: absolute;
	top: 50%;
	width: .04em;
}

.mouth {
	background: #ad002f;
	border-radius: 50% / 30% 30% 70% 70%;
	height: .04em;
	left: 50%;
	margin: .07em 0 0 -.05em;
	position: absolute;
	top: 50%;
	width: .1em;
}

/* rosie cheeks */
.mouth::before,
.mouth::after {
	background: #fcc9b0;
	border-radius: 50%;
	content: '';
	display: inline-block;
	height: .06em;
	position: absolute;
	top: -.04em;
	width: .06em;
}

.mouth::before {
	left: -.07em;
}

.mouth::after {
	left: .11em;
}

.body {
	background: #c72f43;
	background: -webkit-radial-gradient(center top, 0.35em .05em, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, .2) 49%, rgba(199, 47, 67, 0) 50%, rgb(199, 47, 67) 51%);
	border-top-left-radius: 20% 65%;
	border-top-right-radius: 20% 65%;
	border-bottom-left-radius: 50% 15%;
	border-bottom-right-radius: 50% 15%;
	box-shadow: 0 .005em 0 rgba(0,0,0,.4);
	height: .6em;
	left: 50%;
	margin: -.04em 0 0 -.3em;
	position: relative;
	width: .6em;
}

/* placket - general */
.body::before,
.body::after {
	background: #ebc55d;
	bottom: -.5%;
	content: '';
	display: block;
	height: 96.4%;
	left: 50%;
	margin-left: -.1em;
	position: absolute;
	width: .1em;
}

/* placket - left */
.body::before {
	border-radius: 70% 0 0 100% / 100% 0 0 2%;
	box-shadow: .005em 0 0 rgba(0,0,0,.3) inset;
}

/* placket - right */
.body::after {
	border-radius: 0 70% 100% 0 / 0 100% 2% 0;
	box-shadow: -.005em 0 0 rgba(0,0,0,.3) inset;
	margin-left: 0;
}

.arm {
	border: .005em solid rgba(0,0,0,.2);
	height: .1em;
	position: absolute;
	top: 30%;
	width: .1em;
}

.left.arm {
	border-left: none;
	left: .05em;
	-webkit-transform: skew(-10deg, 5deg);
}

.right.arm {
	border-right: none;
	right: .05em;
	-webkit-transform: rotate(-40deg);
}

/* hands */
.arm::after {
	background: #efdfab;
	display: block;
	height: 100%;
	overflow: hidden;
	position: relative;
	width: 50%;
	content: '';
}

/* left hand */
.left.arm::after {
	border-radius: 0 50% 50% 0;
	right: -100%;
}

/* right hand */
.right.arm::after {
	border-radius: 50% 0 0 50%;
	left: -50%;
}

/*--------------------
	specific doll styles
	-------------------- */
/* doll2 */
.master.doll > .doll > .head {
	background: #ea8623;
}

.master.doll > .doll > .body {
	background: -webkit-radial-gradient(center top, 0.35em .05em, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, .2) 49%, rgba(234, 134, 35, 0) 50%, rgb(234, 134, 35) 51%);
}

.master.doll > .doll > .body::before,
.master.doll > .doll > .body::after {
	background: #9ece44;
}

/* doll3 */
.master.doll > .doll  > .doll > .head {
	background: #ebc55d;
}

.master.doll > .doll  > .doll > .body {
	background: -webkit-radial-gradient(center top, 0.35em .05em, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, .2) 49%, rgba(235, 197, 93, 0) 50%, rgb(235, 197, 93) 51%);
}

.master.doll > .doll  > .doll > .body::before,
.master.doll > .doll  > .doll > .body::after {
	background: #4560cc;
}

/* doll4 */
.master.doll > .doll > .doll > .doll > .head {
	background: #9ece44;
}

.master.doll > .doll > .doll > .doll > .body {
	background: -webkit-radial-gradient(center top, 0.35em .05em, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, .2) 49%, rgba(158, 206, 68, 0) 50%, rgb(158, 206, 68) 51%);
}

.master.doll > .doll > .doll > .doll > .body::before,
.master.doll > .doll > .doll > .doll > .body::after {
	background: #8845cc;
}

/* doll5 */
.master.doll > .doll > .doll > .doll > .doll > .head {
	background: #4560cc;
}

.master.doll > .doll > .doll > .doll > .doll > .body {
	background: -webkit-radial-gradient(center top, 0.35em .05em, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, .2) 49%, rgba(69, 96, 204, 0) 50%, rgb(69, 96, 204) 51%);
}

.master.doll > .doll > .doll > .doll > .doll > .body::before,
.master.doll > .doll > .doll > .doll > .doll > .body::after {
	background: #c72f43;
}

/* doll6 */
.master.doll > .doll > .doll > .doll > .doll > .doll > .head {
	background: #8845cc;
}

.master.doll > .doll > .doll > .doll > .doll > .doll > .body {
	background: -webkit-radial-gradient(center top, 0.35em .05em, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, .2) 49%, rgba(136, 69, 204, 0) 50%, rgb(136, 69, 204) 51%);
}

.master.doll > .doll > .doll > .doll > .doll > .doll > .body::before,
.master.doll > .doll > .doll > .doll > .doll > .doll > .body::after {
	background: #ea8623;
}




/*----------------
	media queries
	---------------- */
/* all showing */
@media screen and (min-width: 1520px) {
	.master.doll {
		left: 80%;
	}
}

/* doll6 in air */
@media screen and (min-width: 1480px) and (max-width: 1519px) {
	.master.doll {
		left: 80%;
	}

	.master.doll > .doll > .doll > .doll > .doll > .doll {
		left: 50%;
		top: -.5em;
	}

	.master.doll > .doll > .doll > .doll > .doll > .doll::after {
		background: rgba(0, 0, 0, 0);
	}

	.master.doll > .doll > .doll > .doll > .doll > .head {
		-moz-transform: rotate(75deg);
		-ms-transform: rotate(75deg);
		-o-transform: rotate(75deg);
		-webkit-transform: rotate(75deg);
		transform: rotate(75deg);
	}
}

/* 1-5 showing */
@media screen and (min-width: 1380px) and (max-width: 1479px) {
	.master.doll {
		left: 80%;
	}

	.master.doll > .doll > .doll > .doll > .doll > .doll {
		left: 50%;
	}
}

/* 5 in air */
@media screen and (min-width: 1330px) and (max-width: 1379px) {
	.master.doll {
		left: 80%;
	}

	.master.doll > .doll > .doll > .doll .doll {
		left: 50%;
	}

	.master.doll > .doll > .doll > .doll > .doll {
		top: -.5em;
	}

	.master.doll > .doll > .doll > .doll > .doll::after {
		background: rgba(0, 0, 0, 0);
	}

	.master.doll > .doll > .doll > .doll > .head {
		-moz-transform: rotate(75deg);
		-ms-transform: rotate(75deg);
		-o-transform: rotate(75deg);
		-webkit-transform: rotate(75deg);
		transform: rotate(75deg);
	}
}

/* 1-4 showing */
@media screen and (min-width: 1240px) and (max-width: 1329px) {
	.master.doll {
		left: 80%;
	}

	.master.doll > .doll > .doll > .doll .doll {
		left: 50%;
	}
}

/* 4 in air */
@media screen and (min-width: 1200px) and (max-width: 1239px) {
	.master.doll {
		left: 75%;
	}

	.master.doll > .doll > .doll .doll {
		left: 50%;
	}

	.master.doll > .doll > .doll > .doll {
		top: -.5em;
	}

	.master.doll > .doll > .doll > .doll::after {
		background: rgba(0, 0, 0, 0);
	}

	.master.doll > .doll > .doll > .head {
		-moz-transform: rotate(75deg);
		-ms-transform: rotate(75deg);
		-o-transform: rotate(75deg);
		-webkit-transform: rotate(75deg);
		transform: rotate(75deg);
	}
}

/* 1-3 showing */
@media screen and (min-width: 1150px) and (max-width: 1199px) {
	.master.doll {
		left: 75%;
	}

	.master.doll > .doll > .doll .doll {
		left: 50%;
	}
}

/* 3 in air */
@media screen and (min-width: 1100px) and (max-width: 1149px) {
	.master.doll {
		left: 75%;
	}

	.master.doll > .doll .doll {
		left: 50%;
	}

	.master.doll > .doll > .doll {
		top: -.5em;
	}

	.master.doll > .doll > .doll::after {
		background: rgba(0, 0, 0, 0);
	}

	.master.doll > .doll > .head {
		-moz-transform: rotate(75deg);
		-ms-transform: rotate(75deg);
		-o-transform: rotate(75deg);
		-webkit-transform: rotate(75deg);
		transform: rotate(75deg);
	}
}

/* 1-2 showing */
@media screen and (min-width: 1028px) and (max-width: 1099px) {
	.master.doll {
		left: 70%;
	}

	.master.doll > .doll .doll {
		left: 50%;
	}
}

/* 2 in air */
@media screen and (min-width: 967px) and (max-width: 1027px) {
	.master.doll {
		left: 70%;
	}

	.master.doll .doll {
		left: 50%;
	}

	.master.doll > .doll {
		top: -.5em;
	}

	.master.doll > .doll::after {
		background: rgba(0, 0, 0, 0);
	}

	.master.doll > .head {
		-moz-transform: rotate(75deg);
		-ms-transform: rotate(75deg);
		-o-transform: rotate(75deg);
		-webkit-transform: rotate(75deg);
		transform: rotate(75deg);
	}
}

/* 1 showing */
@media screen and (max-width: 966px) {
	.master.doll {
		left: 50%;
	}

	.master.doll .doll {
		left: 50%;
	}
}
              
            
!

JS

              
                // no js
              
            
!
999px

Console