I want to create this design in HTML/CSS and add a text over it on each looking square.
How can i achieve it in html and CSS?
This pattern should be responsive also that's why i want it coded so later on various screens it can me modified and adjusted. I want to know if its possible in css and also is there any library for these types of shapes?
I tried clip mask but it doesn't give the whole thing as i have shown. I also tried adding the image directly and adding the text over it in position absolute manner but its breaking the design on small screens below 1200px. Any help will be appreciated.
Here is the attached code it gives the first half only i want to know how can i achieve all four.
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f5f5f5;
}
.union-shape {
width: 800px;
height: 300px;
background: linear-gradient(to bottom, #e8ebfa, #c2c6f1);
clip-path: path("M 0,50 A 50,50 0 0 1 50,0 H 450 A 50,50 0 0 1 500,50 V 120 A 50,50 0 0 0 550,170 H 850 A 50,50 0 0 1 900,220 V 250 A 50,50 0 0 1 850,300 H 50 A 50,50 0 0 1 0,250 Z");
position: relative;
}
/* Optional Grid Overlay */
.union-shape::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
background-image: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
background-size: 40px 40px;
top: 0;
left: 0;
}
<body>
<div class="union-shape"></div>
</body>