In the project, I was asked to draw the strip of light in the red box as shown in the figure. I tried some methods but couldn't fully realize it, especially the tail parts at both ends. Of course, I also know that converting img to css is the fastest, but The converted code was so large that it was rejected. So I am very curious, is there really a CSS or canvas method to achieve it?
canvas, draw the picture directly
You can also use css gradients
It is recommended that you read: ww.w3cplus.com/css3/new-css3-linear-gradient.html