I have above image and i want to make this structure with HTML CSS.
How to make shapes using html css Please any one can help me.
Please help me to create inner structure of like above image by using HTML CSS, Thanks in advance 🙂
I have above image and i want to make this structure with HTML CSS.
How to make shapes using html css Please any one can help me.
Please help me to create inner structure of like above image by using HTML CSS, Thanks in advance 🙂
2
Answers
Learn about the CSS
clip-path
property. This allows you to cut elements into shapes. In particular, you’ll want to usepolygon()
. For example, if I wanted to cut a<div>
into a triangle, I could do it like this:Each comma separated part is an X,Y pair. You can learn more about it here: https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path. That should help you get started—you’ll just have to figure out what series of X,Y percentages will create the shape you want (you can cut into either the red shape or the white one—it doesn’t matter).
Add this to css of the red background div
You can also generate another from here