problem description
Uh, the design draft is here:
CSSCSS3:
:
:
the CSS code for the above effect is as follows
.title-box {
width: 40.8%;
height: 75px;
position: relative;
}
.title-box::before {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
transform: scaleY(1.3) perspective(.5em) rotateX(5deg);
transform-origin: bottom;
background: -sharp0F2F5B;
background-image:
linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 0),
linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 0);
background-size: 10px 10px;
}
in addition, I have also discussed other trapezoid implementation methods of Baidu, and found that trapezoids can also be simulated with borders, but as far as I know, the border cannot be set as a grid border, so it is impossible to realize the grid background.
if you can"t solve it with CSS, I"m going to use the background image as the background implementation, but then you have to consider the size of the image under different screen sizes, which is also an alternative.
ask for help
anyone who is familiar with CSS would like to give us some ideas. Thank you.