I want to create triangle as shown in image. Does someone know how to achieve the effect?
Here is a fiddle that should solve your problem. I used :before and :after on a container to place two squares over the container with borders to create the arrows. You can mess with the border colors and widths to get the arrows how you want them (just remember the inside borders have to be the same weight to make an symmetrical triangle).
http://jsfiddle.net/Smzmn/
.hero {
background: url(http://d.pr/i/eqn9+);
height: 200px;
position: relative;
}
.hero:before, .hero:after {
box-sizing: border-box;
content: " ";
position: absolute;
top:0;
display: block;
width: 50%;
height: 100%;
border: 30px solid orange;
border-bottom-color: pink;
}
.hero:before {
left: 0;
border-right: 20px solid transparent;
border-left: 0;
}
.hero:after {
right: 0;
border-left: 20px solid transparent;
border-right: 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With