I am trying to create a banner with a background image, behind a triangle shaped border:
I have tried using borders on both the :before and :after pseudo selectors, but I cannot achieve the above, especially when it comes to responsiveness.
<div class="contact-banner banner">
<img src="background.jpg" />
<div class="contact-banner-inner bg-light">
<div class="container">
<div class="content-inner">
<!-- Content will go here -->
</div>
</div>
</div>
</div>
.contact-banner-inner:before {
content: '';
position: absolute;
content: '';
width: 0;
height: 0;
border-style: solid;
border-width: 0 40vh 40vh 0;
border-color: transparent #f7f7f7 transparent transparent;
left: 7%;
top: 0;
position: absolute;
z-index: 3;
}
.contact-banner-inner:after {
content: '';
width: 0;
height: 0;
border-style: solid;
border-width: 0 40vh 40vh 0;
border-color: transparent #f7f7f7 transparent transparent;
left: 7%;
bottom: 0;
position: absolute;
z-index: 3;
transform: rotate(90deg);
}
Any help would be greatly appreciated. Thanks