Home > Article > Web Front-end > CSS realizes the effect of bookmark pattern
This time I will bring you the effect of using CSS to implement bookmark patterns. What are the precautions for implementing bookmark patterns with CSS? The following is a practical case, let’s take a look.
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: '书签'; box-shadow: 0 5px 5px -5px #000; } .p2:after { /*书签的夹角*/ content: ''; 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>I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related matters on the PHP Chinese website article! Recommended reading:
Detailed graphic explanation of float in css
Four hiding methods in html+css
The above is the detailed content of CSS realizes the effect of bookmark pattern. For more information, please follow other related articles on the PHP Chinese website!