surgiie surgiie - 6 months ago 38
HTML Question

Add a triangle bend to a drop shadow to div

So i have this site im redeveloping for a client and it was made like 10 years ago. Currently their entire footer banner is an image. Im trying to preserve the footer to look exactly like the image without having to rely on using an image for the entire content which seems redundant to me because this can be done with HTML and CSS. So im trying style it exact but cant seem to figure this slight triangular bend effect. I want to add a drop shadow effect to the top border of my footer only with a slight triangle bend effect on top of the logo for the site like this: Desired effect

I can add the drop shadow straight across no problem, but im not sure how to add that slight triangle effect like in the image. Im using bootstrap for responsiveness, so have dug around their docs to see if they had any helper classes to help me achieve this. Im not the greatest css expert so i have no idea how to achieve this effect. Is there a way using purely css? javascript or jquery will work too if needed.

This is the basic layout(3 column) of my markup and styles:

<div class="row drop-shadow">
<div class="col-lg-4">
//content not added yet
</div>
<div class="col-lg-4">
//content not added yet
</div>
<div class="col-lg-4">
//content not added yet
</div>

</div>


.drop-shadow{box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2)}


Thanks!

Answer

Just a quick possibility here, but this code creates a simple triangle. You could use it to position the triangle absolute to the element w/ the box-shadow. This is the fastest solution I could come up with.

I edited the answer since you've added the CSS & HTML.