重论画尖角

之前有讲过画尖角的,今天重新论述一下这个,来看一下下面的代码

<style>
    .style-1{
        height: 0;
        font-size: 0;
        line-height: 0;
        border-style: solid;
        border-width: 7px 7px 7px 0;
        border-color: transparent red;
    }
    .style-2{
        height: 0;
        font-size: 0;
        line-height: 0;
        border-style: solid;
        border-width: 7px 0px 7px 7px;
        border-color: transparent red;
    }
    .style-3{
        height: 0;
        font-size: 0;
        line-height: 0;
        border-style: solid;
        border-width: 7px;
        border-color: transparent red;
    }
    .style-4{
        height: 0;
        font-size: 0;
        line-height: 0;
        border-style: solid;
        border-width: 7px;
        border-color:  red transparent;
    }
</style>
<i class="style-1"></i><br>
<i class="style-2"></i><br>
<i class="style-3"></i><br>
<i class="style-4"></i>

这里代码其实不难理解,直接上效果图:


image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容