haizlin / fe-interview

前端面试每日 3+1,以面试题来驱动学习,提倡每日学习与思考,每天进步一点!每天早上5点纯手工发布面试题(死磕自己,愉悦大家),6000+道前端面试题全面覆盖,HTML/CSS/JavaScript/Vue/React/Nodejs/TypeScript/ECMAScritpt/Webpack/Jquery/小程序/软技能……

Home Page:http://www.h-camel.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[css] 第661天 使用css制作一个圣诞树

haizhilin2013 opened this issue · comments

第661天 使用css制作一个圣诞树

3+1官网

我也要出题

圣诞树

<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>圣诞树</title>
<style>
.header{
    width: 0px;
    height: 0px;
    border-top: 100px solid white;
    border-right: 100px solid white;
    border-bottom: 100px solid green;
    border-left: 100px solid white;
    float: left;
    margin-left: 100px;
}
.main{
    width: 0px;
    height: 0px;
    border-top: 200px solid white;
    border-right: 200px solid white;
    border-bottom: 200px solid green;
    border-left: 200px solid white;
}
.footer{
    width: 100px;
    height: 200px;
    background: gray;
    margin-left: 150px;
}
</style>
</head>
<body>
    <div class="header"></div>
    <div class="main"></div>
    <div class="footer"></div>
</body>
</html>

css片段:
.container {
display: flex;
flex-direction: column;
align-items: center;
}
.leaf {
width: 400px;
height: 700px;
clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
background-color: green;
}
.bar {
width: 100px;
height: 200px;
background-color: chocolate;
}