题解 | #圣诞树#

圣诞树

https://www.nowcoder.com/practice/4924913926d94e96a70bbf2a50847852

代码如下:
  1.先把三角形弄出来      只需要将除底边框的颜色都设置透明色
  2.通过浮动让小三角形脱离文档流 接着再用左外边距调居中即可
<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8>
        <style type="text/css">
            .topbranch {
                width: 0px;
                height: 0px;
                /*
                * TODO: 上枝叶效果
                */
                    border-width:100px;
                border-style:solid;
                border-color:transparent transparent green transparent;
                float:left;
                margin-left:100px;
                
            }
            .middleBranch {
                width: 0px;
                height: 0px;
                /*
                * TODO: 中枝叶效果
                */
                 border-width:200px;
                border-style:solid;
                border-color:transparent transparent green transparent;
               
            }
            .base {
                /*
                * TODO: 树干效果
                */
                width:70px;
                height:200px;
                background-color:gray;
                margin-left:165px;
               
            }
        </style>
    </head>
    <body>
        <section class="topbranch"></section>
        <section class="middleBranch"></section>
        <section class="base"></section>
    </body>
</html>
#社畜简单的快乐#
全部评论

相关推荐

你背过凌晨4点的八股文么:简历挂了的话会是流程终止,像我一样
点赞 评论 收藏
分享
运营3年修炼中接简历辅导:你的科研项目经历里,只写了你的动作,没有写你的思考和成果,不要只写使用什么进行了什么,这等于罗列你的任务,简历是为了突出你的优秀,你在什么样的任务背景下,克服了什么样的困难,针对性地做了哪些事情,最后达成了什么成果(用数据体现你的成果和效率)
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务