I’m stuck with one task and I can’t find any solution over the internet.
I have this situation:
Images 1 and 2 has background images.
I need one 1st or 2nd image have that bump.
If it would be 1st image, that bump should extend div bottom and overlay the 2nd background.
If it would be 2nd div then I need like a crater/hole at the top and be under 1st div.
I can’t cut my images to .png/.gif and cut with that bump in photoshop. These images are changed by client, so he can’t prepare exact images all the time, so I need to extend them by code.
I tried to radial-gradient() background and cut with svg, but those aren’t supported by Firefox.
Is it possible to make this with code who adapts to all background images?
2
Answers
You need to use border-color
border-color: transparent transparent #555 transparent;
Basically you need to mark some percentage of left and right of the image border-color as transparent.
And then set border-radius to give the curve
Thanks.
Here is a solution that uses background-size: cover, so it is easier to adapt. (It would be easier with known dimension images).
The drawback is a little complex markup, 3 auxiliar divs are needed.
The curves are standard border-radius, so that can be adjusted as needed