首页 > Web开发 > 详细

记一次前端css样式的三角形的应用

时间:2019-04-05 14:05:19      阅读:154      评论:0      收藏:0      [点我收藏+]

1)面试题是这样的要求用css实现技术分享图片

<section>
                <div></div>
                <div></div>
        </section>
        
        <style>
          div{
                position:relative;
                width:200px;
                height:50px;
                background:red;
                float:left;
                margin-left:10px;
            }
            div::before{
                content:"";
                display:block;
                position:absolute;
                top:0;
                left:0px;
                width:0px;
                height:0px;
                border-top:25px solid transparent;
                border-bottom:25px solid transparent;
                border-left:25px solid #fff;
                z-index:1;
            }
            div::after{
                content:"";
                display:block;
                position:absolute;
                top:0;
                right:-25px;
                width:0px;
                height:0px;
                border-top:25px solid transparent;
                border-bottom:25px solid transparent;
                border-left:25px solid red;
                z-index:2;
            }
        </style>

  

 

记一次前端css样式的三角形的应用

原文:https://www.cnblogs.com/llcMite/p/10658484.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!