css绘制一个响应式自适应建筑小洋房楼房效果代码
代码语言:html
所属分类:响应式
代码描述:css绘制一个响应式自适应建筑小洋房楼房效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
}
body {
display: flex;
align-items: center;
justify-content: flex-end;
flex-direction: column;
height: 100vh;
background: #a2d8f3;
}
.body {
position: relative;
}
.roof .top {
width: calc(100% + 2 * calc(2 * 1vmin));
background: linear-gradient(#DD9980, #DD9980 50%, #AF5842 50%);
height: calc(2 * 1vmin);
position: relative;
left: calc(-2 * 1vmin);
}
.roof .top:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 1vmin 0 0 1vmin;
border-color: transparent transparent transparent #a2d8f3;
}
.roof .top:after {
content: "";
position: absolute;
bottom: 0;
right: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 0 1vmin 1vmin;
border-color: transparent transparent #a2d8f3 transparent;
}
.roof .middle {
width: calc(100% + calc(2 * 1vmin));
background-image: linear-gradient(90deg, #D8785B 25%, #AF5842 25%, #AF5842 50%, #D8785B 50%, #D8785B 75%, #AF5842 75%, #AF5842 100%);
background-size: calc(6 * 1vmin) calc(6 * 1vmin);
height: calc(2 * 1vmin);
position: relative;
left: calc(-1 * 1vmin);
}
.roof .bottom {
width: 100%;
background: #AF5842;
height: calc(4 * 1vmin);
display: flex;
align-items: center;
justify-content: space-around;
padding: 0 1vmin;
}
.roof .bottom span {
border: calc(0.75 * 1vmin) solid #86432F;
border-bottom: none;
width: calc( 80% / 4);
height: 100%;
position: relative;
}
.roof .bottom span:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0 auto;
background: #86432F;
height: calc(2 * 1vmin);
width: calc(4 * 1vmin);
border-top-right-radius: calc(2 * 1vmin);
border-top-left-radius: calc(2 * 1vmin);
}
.chimney1 {
width: calc(3 * 1vmin);
height: calc(4 * 1vmin);
background: #D8785B;
position: absolute;
left: calc(6 * 1vmin);
top: calc(-4 * 1vmin);
}
.chimney1:before {
position: absolute;
top: 0;
content: "";
width: calc(100% + 1vmin);
left: calc(-0.5 * 1vmin);
height: 1vmin;
background: #DD9980;
}
.chimney2 {
width: calc(6 * 1vmin);
height: calc(4 * 1vmin);
background: #D8785B;
position: absolute;
left: calc(12 * 1vmin);
top: calc(-4 * 1vmin);
}
.chimney2:before {
position: absolute;
top: 0;
content: "";
width: calc(100% + 1vmin);
left: calc(-0.5 * 1vmin);
height: 1vmin;
background: #DD9980;
}
.antenna {
position: absolute;
right: calc(8 * 1vmin);
top: calc(-7 * 1vmin);
width: 1vmin;
height: calc(7 * 1vmin);
background: #889BAD;
}
.antenna:before {
content: "";
position: absolute;
height: 1vmin;
width: calc(10 * 1vmin);
left: calc(-4.5 * 1vmin);
top: 1vmin;
background: #889BAD;
}
.antenna span {
position: absolute;
width: 1vmin;
background: #889BAD;
}
.antenna .ant1 {
height: calc(4 * 1vmin);
left: calc(-4.5 * 1vmin);
top: calc(-0.5 * 1vmin);
}
.antenna .ant2 {
height: calc(3 * 1vmin);
left: calc(-2 * 1vmin);
}
.antenna .ant3 {
height: calc(3 * 1vmin);
right: ca.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0