Example of implementing bookmark effect with CSS

高洛峰
Release: 2017-02-25 14:54:17
Original
2546 people have browsed it

This article writes a bookmark effect through pure CSS code. The bookmark effect after implementation is very beautiful. The complete sample code is given in the article. The implemented code is also very simple, which is very convenient for everyone to understand and learn. If necessary, Friends can refer to it and learn together.

The effect diagram achieved is as follows:

Example of implementing bookmark effect with CSS

##The sample code is as follows:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>border制作书签(图形)</title>
        <style>
            .p2: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: &#39;书签&#39;;
                box-shadow: 0 5px 5px -5px #000;
            }
            .p2:after { /*书签的夹角*/
                content: &#39;&#39;;
                position: absolute;
                top: 80px;
                left: 20px;
                border: 4px solid #89540c;
                border-left-color: transparent;
                border-bottom-color: transparent;
            }
        </style>
    </head>
    <body>
        <p class="p1"></p>
        <p class="p2"></p>
    </body>
</html>
Copy after login

Summary

The above is the entire content of this article. I hope the content of this article can bring some help to everyone's study or work. If you have any questions, You can leave messages to communicate.

For more articles related to CSS implementation of bookmark effect examples, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!