css绘制现代房屋大树艺术效果代码
代码语言:html
所属分类:布局界面
代码描述:css绘制现代房屋大树艺术效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
}
.wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
height: 100vh;
width: 100%;
background: #cbe0f4;
}
.road {
height: calc(4 * 1vmin);
width: 100%;
background: #575757;
}
.grass {
height: calc(2 * 1vmin);
width: 100%;
background: #859e53;
}
.building {
width: calc(1vmin * 29);
height: calc(1vmin * 32.5);
border-left: calc(1.5 * 1vmin) solid #fff;
border-right: calc(1.5 * 1vmin) solid #fff;
background: #fff;
position: relative;
}
.roof {
width: 0;
height: 0;
border-style: solid;
border-width: 0 calc(14.5 * 1vmin) calc(12 * 1vmin) calc(14.5 * 1vmin);
border-color: transparent transparent #fff transparent;
position: relative;
}
.roofInner {
width: 0;
height: 0;
border-style: solid;
border-width: 0 calc(13 * 1vmin) calc(11 * 1vmin) calc(13 * 1vmin);
border-color: transparent transparent transparent transparent;
position: absolute;
top: calc(2 * 1vmin);
left: 0;
transform: translateX(-50%);
}
.roofPatch1 {
width: calc(2 * 1vmin);
height: 1vmin;
background: #fff;
position: absolute;
left: calc(-13.5 * 1vmin);
top: calc(12 * 1vmin);
}
.roofPatch2 {
width: calc(2 * 1vmin);
height: 1vmin;
background: #fff;
position: absolute;
right: calc(-13.5 * 1vmin);
top: calc(12 * 1vmin);
}
.roofPatch3 {
width: 1vmin;
height: calc(3 * 1vmin);
background: #fff;
position: absolute;
left: calc(-14.05 * 1vmin);
top: calc(13 * 1vmin);
z-index: 6;
}
.roofPatch4 {
width: 1vmin;
height: calc(3 * 1vmin);
background: #fff;
position: absolute;
right: calc(-14.05 * 1vmin);
top: calc(13 * 1vmin);
z-index: 6;
}
.roofPatch5 {
width: 1vmin;
height: calc(3 * 1vmin);
background: #fff;
position: absolute;
z-index: 7;
top: 1vmin;
left: calc(0.5 * 1vmin);
transform: rotate(-51deg);
}
.roofPatch6 {
width: 1vmin;
height: calc(3 * 1vmin);
background: #fff;
position: absolute;
z-index: 7;
top: 1vmin;
left: calc(-1.7 * 1vmin);
transform: rotate(51deg);
}
.roofShadow1 {
background: #8f5549;
height: calc(1.5 * 1vmin);
width: calc(18.5 * 1vmin);
transform: rotate(140deg);
position: absolute;
top: calc(7.9 * 1vmin);
left: calc(-15.7 * 1vmin);
z-index: 5;
}
.roofShadow2 {
background: #8f5549;
height: calc(1.5 * 1vmin);
width: calc(18.5 * 1vmin);
transform: rotate(-140deg);
position: absolute;
top: calc(7.9 * 1vmin);
right: calc(-15.7 * 1vmin);
z-index: 5;
}
.topPart {
width: 100%;
height: calc(21.5 * 1vmin);
background-image: linear-gradient(0deg, #af6356 4.55%, #aa5e51 4.55%, #aa5e51 50%, #af6356 50%, #af6356 54.55%, #aa5e51 54.55%, #aa5e51 100%);
background-size: calc(5 * 1vmin) calc(5 * 1vmin);
position: absolute;
top: -8vmin;
-webkit-clip-path: polygon(50% 0, 50% 0, 100% 50%, 100% 100%, 0 100%, 0% 50%);
clip-path: polygon(50% 0, 50% 0, 100% 50%, 100% 100%, 0 100%, 0% 50%);
}
.topPart .window1 {
position: absolute;
top: calc(9 * 1vmin);
left: calc(4.5 * 1vmin);
width: calc(4.4 * 1vmin);
height: calc(9.5 * 1vmin);
border: calc(0.4 * 1vmin) solid #fff;
background: linear-gradient(180deg, #51a8c2 50%, #51a8c2 50%, #1e3e48 50%);
}
.topPart .window1:before {
content: "";
width: 100%;
height: 100%;
background: linear-gradi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0