Struggling to add a point or triangle shape to my div with a background image, finding it difficult to create enough open space.
This is the desired outcome:
https://i.sstatic.net/LZVaF.png
This is what I have implemented so far:
<div class="bg"></div>
.bg {
position: relative;
background: url('http://i.imgur.com/W27LCzB.jpg');
background-size: cover;
width: 100%;
padding-top: 50px;
height: 200px;
}
.bg:before {
content:'';
border-left: 50px solid #fff;
border-right: 50px solid #fff;
border-bottom: 50px solid transparent;
position:absolute;
top: 0;
left: 0;
right: 0;
margin: 0 auto;
width: 0;
}
Attempted to follow guidance from this Stack Overflow question, but encountered issues where borders extend from the edges of the rectangular div.