In normal development, we usually use convex rounded corners, that is, the border-radius attribute. If there is a concave corner, we generally consider two implementation methods. One is to use the background image directly, and the other is to use CSS. The properties used are background or background-image combined with radial-gradient. Example: background-image: radial-gradient(200px at 50px 0px, #fff 50px, #4169E1 50px); For radial gradient, there are mainly 3 parameters to control. One is the origin and size. The size is similar to border-radius. The origin is represented by at, which can specify the coordinates of the point, or by left, right, top, and bottom. Next are two colors and transparency, size, etc. Here 50px or percentage, I have tested the first one, only 50 is semi-rounded, while the second 50px seems to have little effect. Example: To achieve the light green concave corner style shown in the picture, there is no material picture. Start: First, set the width and height of this div and set relative positioning. Then put 4 absolutely positioned elements inside it, set their width and height equal to the size of the concave, and then absolutely position them to fix them to the 4 corners. Then use the concave style above. It should be noted that the top two are very easy to complete, but the bottom two corners, after only setting the position and the concave position, are like this: This requires another rotation. The complete code is as follows: CSS: .notice_box_cls #commonNotice { background-color: #E8F7F2; padding: 20px 10px; } .notice_box_cls .notice_body0 { position: relative; } .notice_box_cls .notice_body { background:radial-gradient(15px at left top,#fff 50px,#E8F7F2 50%); position: absolute; left: 0; top: 0; width: 15px; height: 15px; } .notice_box_cls .notice_body1 { background:radial-gradient(15px at right top,#fff 50px,#E8F7F2 50%); position: absolute; right: 0; top: 0; width: 15px; height: 15px; } .notice_box_cls .notice_body2 { background:radial-gradient(15px at right bottom,#fff 50px,#E8F7F2 50%); position: absolute; left: 0; bottom: 0; width: 15px; height: 15px; transform: rotate(90deg); } .notice_box_cls .notice_body3 { background:radial-gradient(15px at left bottom,#fff 50px,#E8F7F2 50%); position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; transform: rotate(270deg); } html: <div class="notice"> <div class=""> <div class="notice_title"> <span>Notices and Announcements</span> </div> <div class="notice_body0"> <ul id="commonNotice"> <!-- <li><a href="#" class="fl">Hubei Province Education Informatization S1</a><i class="fr">2017-5-13</i></li> <li><a href="#" class="fl">Hubei Province Education Informatization S2</a><i class="fr">2017-5-13</i></li> <li><a href="#" class="fl">Hubei Province Education Informatization S3</a><i class="fr">2017-5-13</i></li> <li><a href="#" class="fl">Hubei Province Education Informatization S4</a><i class="fr">2017-5-13</i></li> <li><a href="#" class="fl">Hubei Province Education Informatization S5</a><i class="fr">2017-5-13</i></li> <li><a href="#" class="fl">Hubei Province Education Informatization S6</a><i class="fr">2017-5-13</i></li> --> </ul> <div class="notice_body"> </div> <div class="notice_body1"> </div> <div class="notice_body2"> </div> <div class="notice_body3"> </div> </div> </div> </div> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Several ways to improve the readability of web pages
>>: Detailed process of Vue front-end packaging
Preface When we forget the MySQL database passwor...
On Linux, bash is adopted as the standard, which ...
Simple implementation of Mysql add, delete, modif...
I am using LDAP user management implemented in Ce...
Problem Description Today, when I was modifying t...
Some attributes about elements In the daily devel...
At the end of last year, I replaced the opensuse ...
Preface An index is a data structure that sorts o...
As shown in the figure: There are many files conne...
Table of contents introduce Installation and Usag...
Data backup and restore part 3, details are as fo...
Table of contents 1. Use the "rpm -ivh insta...
1. Download related tools and images Download Lin...
Table of contents Preface Global Lock Full databa...
The floating-point types supported in MySQL are F...