div布局实现书桌闹钟书本仙人掌效果
代码语言:html
所属分类:布局界面
代码描述:div布局实现书桌闹钟书本仙人掌效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html {
background: #ECD590;
background-size: cover;
text-align: center;
font-size: 10px;
}
body {
margin: 0;
font-size: 2rem;
display: -webkit-box;
display: flex;
-webkit-box-flex: 1;
flex: 1;
width: 100vw;
min-height: 100vh;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
}
.shelf {
position: relative;
width: 520px;
height: 20px;
border-radius: 1px;
background-color: #5a3f21;
margin-top: 70px;
box-shadow: 0px 0px #e5c564, -1px 1px #e5c564, -2px 2px #e5c564, -3px 3px #e5c564, -4px 4px #e5c564, -5px 5px #e5c564, -6px 6px #e5c564, -7px 7px #e5c564, -8px 8px #e5c564, -9px 9px #e5c564, -10px 10px #e5c564, -11px 11px #e5c564, -12px 12px #e5c564, -13px 13px #e5c564, -14px 14px #e5c564, -15px 15px #e5c564, -16px 16px #e5c564, -17px 17px #e5c564, -18px 18px #e5c564, -19px 19px #e5c564, -20px 20px #e5c564;
}
.clock {
width: 110px;
height: 110px;
border: 10px solid #5AA668;
background-color: #E9E6C9;
border-radius: 50%;
position: absolute;
box-shadow: inset 0 0 3px #6a5757;
left: 30px;
top: -135px;
}
.clock-face {
position: relative;
width: 100%;
height: 100%;
}
.knot {
position: absolute;
background-color: #9d374f;
width: 10px;
height: 10px;
border-radius: 50%;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
z-index: 99;
}
.hand {
width: 4px;
background: #47321A;
position: absolute;
left: 50%;
top: 50%;
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transform: translate(-50%, -100%);
transform: translate(-50%, -100%);
}
.hour-hand {
height: 30px;
}
.min-hand {
height: 40px;
}
.second-hand {
height: 47px;
width: 2px;
}
.clock-ear-right, .clock-ear-left {
background-color: #5AA668;
position: absolute;
border-top-left-radius: 90px;
border-top-right-radius: 90px;
left: -38px;
top: -12px;
height: 30px;
width: 60px;
-webkit-transform: rotate(-50deg);
transform: rotate(-50deg);
}
.clock-ear-right:after, .clock-ear-left:after {
content: '';
position: absolute;
background-color: #9d374f;
width: 15px;
height: 8px;
border-top-left-radius: 90px;
border-top-right-radius: 90px;
top: -9px;
left: 23px;
}
.clock-ear-right {
left: auto;
right: -38px;
-webkit-transform: rotate(50deg);
transform: rotate(50deg);
}
.clock-foot-right, .clock-foot-left {
background-color: #47321A;
position: absolute;
border-radius: 50px;
left: 20px;
bottom: -25px;
height: 50px;
width: 12px;
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
z-index: -1;
}
.clock-foot-right {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0