当前位置:主页 > 查看内容

利用CSS实现书签效果实例源码

发布时间:2021-09-08 00:00| 位朋友查看

简介:实现的效果图如下: 示例代码如下: !DOCTYPE htmlhtml head meta charset=utf-8 titleborder制作书签(图形)/title style .div2:before { /*做一个书签效果*/ position: absolute; /*必须*/ top: 50px; left: 20px; z-index: 1; height: 0; padding-right:……

实现的效果图如下:

示例代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>border制作书签(图形)</title>
        <style>
            .div2:before { /*做一个书签效果*/
                position: absolute; /*必须*/
                top: 50px;
                left: 20px;
                z-index: 1;
                height: 0;
                padding-right: 10px;
                font-weight: bold;
                line-height: 0;
                color: #000;
                border: 15px solid #ee7600;
                border-right-color: transparent; /*右边框透明,变成空缺的角*/
                content: '书签';
                box-shadow: 0 5px 5px -5px #000;
            }
            .div2:after { /*书签的夹角*/
                content: '';
                position: absolute;
                top: 80px;
                left: 20px;
                border: 4px solid #89540c;
                border-left-color: transparent;
                border-bottom-color: transparent;
            }
        </style>
    </head>
    <body>
        <div class="div1"></div>
        <div class="div2"></div>
    </body>
</html>

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。


原文链接:https://m.jb51.net/css/519058.html
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文


随机推荐