-1

I have received a design from my designer and I was wondering if this is even possible using HTML, CSS or JavaScript?

Triangle one

This seems to be possible using CSS and create a seperate div under the main div with position absolute.

However, if I use a background image on the div, the designer wants it to look as following: Triangle two

I honestly have no idea how to to search for a solution for this, is there any way to achieve this?

PIDZB
  • 903
  • 1
  • 15
  • 38

1 Answers1

1

Here is a quick little thing for the css triangle - you can adjust to suit:

.createdDiv{
  height:100px;
  margin-top:10px;
  background:#ddd;
}

.createdDiv:before{
    content: "";
    border-top: 15px solid white;
    border-right: 15px solid transparent;
    border-left: 15px solid transparent;
    position: absolute;
    top: 10px;
    right: 50%;
    margin-right:-10px;
    z-index:99;
}
<div class='createdDiv'></div>
gavgrif
  • 15,194
  • 2
  • 25
  • 27