<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS3 可爱的企鹅妈妈和宝宝</title>
<style>
.tufts {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
position: relative;
}
.tufts::before {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
content: "";
position: absolute;
}
.tufts::after {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
content: "";
position: absolute;
}
.face {
position: relative;
}
.face:before,
.face:after {
border-radius: 50%;
content: "";
display: block;
position: absolute;
}
.beak {
position: relative;
}
.beak:before {
border-right: 10px solid transparent;
border-left: 10px solid transparent;
content: "";
position: absolute;
height: 0;
width: 0;
}
.beak:after {
border-right: 10px solid transparent;
border-left: 10px solid transparent;
content: "";
position: absolute;
height: 0;
width: 0;
}
.cheeks {
position: relative;
}
.cheeks:before,
.cheeks:after {
background-color: #f2653a;
border-radius: 50%;
content: "";
display: block;
position: absolute;
z-index: 20;
}
.tummy {
position: absolute;
z-index: 10;
}
.feet:before,
.feet:after {
background-color: #fcc160;
content: "";
border-top-left-radius: 150px;
border-top-right-radius: 150px;
position: absolute;
z-index: 20;
}
.feet:before {
bottom: 0;
}
.feet:after {
bottom: 0;
}
.penguin {
position: relative;
margin: 50px 50px 0 100px;
width: 150px;
}
.penguin .tufts {
background: #36484d;
width: 5px;
height: 15px;
top: 0;
left: 72px;
}
.penguin .tufts:before {
background: #36484d;
width: 5px;
height: 20px;
top: 0;
left: -9px;
transform: rotate(-45deg);
}
.penguin .tufts:after {
background: #36484d;
width: 5px;
height: 20px;
top: 0;
left: 9px;
transform: rotate(45deg);
}
.penguin .body {
position: relative;
background: #36484d;
height: 150px;
width: 150px;
border-radius: 150px;
}
.penguin .face:before,
.penguin .face:after {
background-color: #80cfd0;
box-shadow: 0 -4px 0 #1a9ab9 inset;
width: 20px;
height: 20px;
top: 25px;
}
.penguin .face:before {
left: 45px;
}
.penguin .face:after {
right: 45px;
}
.penguin .beak:before {
border-bottom: 10px solid #f9b64c;
top: 50px;
left: 65px;
}
.penguin .beak:after {
border-top: 10px solid #c29444;
top: 60px;
left: 65px;
}
.penguin .cheeks:before,
.penguin .cheeks:after {
width: 23px;
height: 23px;
top: 45px;
z-index: 20;
}
.penguin .cheeks:before {
left: 20px;
}
.penguin .cheeks:after {
right: 20px;
}
.penguin .tummy {
border-top-left-radius: 150px;
border-top-right-radius: 150px;
background-color: #e5e1ce;
bottom: 0;
left: 46px;
height: 65px;
width: 60px;
}
.feet:before,
.feet:after {
height: 10px;
width: 20px;
}
.feet:before {
bottom: 0;
left: 40px;
}
.feet:after {
bottom: 0;
right: 40px;
}
.wings:before,
.wings:after {
content: "";
position: absolute;
z-index: -50;
}
.wings:before {
border-bottom-left-radius: 150px;
border-bottom-right-radius: 150px;
background: #36484d;
height: 30px;
width: 70px;
left: -50px;
top: 40%;
}
.wings:after {
border-bottom-left-radius: 150px;
border-bottom-right-radius: 150px;
background: #898989;
height: 30px;
width: 70px;
right: -20px;
bottom: 19px;
transform: rotate(90deg);
}
.baby-penguin {
position: relative;
margin: 50px 50px 0 50px;
width: 70px;
}
.baby-penguin .body {
position: absolute;
background: #8a8a8a;
border-radius: 150px;
height: 70px;
width: 70px;
top: -120px;
}
.baby-penguin .face:before,
.baby-penguin .face:after {
box-shadow: 0 -3px 0 #44494a inset;
width: 17px;
height: 17px;
top: -101px;
}
.baby-penguin .face:before {
left: 45px;
z-index: 30;
}
.baby-penguin .face:after {
right: 45px;
z-index: 30;
}
.baby-penguin .beak {
z-index: 30;
}
.baby-penguin .beak:after {
border-top: 10px solid #f9b64c;
top: -88px;
left: 25px;
}
.baby-penguin .cheeks:before,
.baby-penguin .cheeks:after {
width: 14px;
height: 11px;
top: -87px;
z-index: 20;
}
.baby-penguin .cheeks:before {
left: 8px;
}
.baby-penguin .cheeks:after {
right: 8px;
}
.baby-penguin .tummy {
border-bottom-left-radius: 25px;
border-bottom-right-radius: 25px;
background-color: #e5e1ce;
bottom: 0;
left: 8px;
height: 25px;
width: 54px;
top: -85px;
}
.baby-penguin .tummy:before {
content: "";
border-top-left-radius: 100px;
border-top-right-radius: 100px;
background-color: #e5e1ce;
position: absolute;
width: 27px;
height: 15px;
top: -15px;
}
.baby-penguin .tummy:after {
content: "";
border-top-left-radius: 100px;
border-top-right-radius: 100px;
background-color: #e5e1ce;
position: absolute;
width: 27px;
height: 15px;
top: -15px;
right: 0;
}
.baby-penguin .feet:before,
.baby-penguin .feet:after {
height: 7px;
width: 10px;
}
.baby-penguin .feet:before {
top: -55px;
left: 15px;
}
.baby-penguin .feet:after {
top: -55px;
right: 15px;
}
@keyframes my-baby {
transform: rotate(-90deg);
}
</style>
</head>
<body>
<div class="penguin">
<div class="tufts"></div>
<div class="body">
<div class="face">
<div class="beak"></div>
<div class="cheeks"></div>
</div>
<div class="tummy"></div>
<div class="wings"></div>
</div>
<div class="feet"></div>
</div>
<div class="baby-penguin">
<div class="body"></div>
<div class="face">
<div class="beak"></div>
<div class="cheeks"></div>
</div>
<div class="tummy"></div>
<div class="feet"></div>
</div>
</body>
</html>