I wanted to create a Ribbon in my current project, but since I’ve never used ribbons before I dont even know how start…
The ribbon should look like this:
On the last longer part I want to add an image inside. Other parts (first light-red and second dark-red parts have to be empty).
I saw many examples online, but nothing that looked like this. Hope someone can help me here…
HTML:
<div class=header-ribbon>
...
...
<img...>
</div>
CSS:
?...
2
Answers
clip-path with gradient can do it.
I used CSS variable so you can easily control the shape:
If you want 3 separate DOM elements, you can get the desired output using
transform()
withperspective()
androtateY()
:I’ve added a placeholder image to the last part as requested in you question.