1
I managed to do so with solid color background
.slide {
width: 100%;
height: 101px;
background-color: #fff;
background-size: cover;
clip-path: polygon(50% 100%, 100% 0%, 0% 0%);
}
.slide_bg{
background-color: #f5f5f5;
padding-bottom:20px;
padding-left:20px;
}
.slide_end {
width: 100%;
height: 101px;
background-color:#f5f5f5;
background-size: cover;
clip-path: polygon(50% 100%, 100% 0%, 0% 0%);
}
.slide_end_bg {
width: 100%;
background-color:#fff;
}
<div class="slide_bg">
<p>
asdasdasd
</p>
<p>
asdasdasd
</p>
<p>
asdasdasd
</p>
</div>
<div class="slide_end_bg">
<div class="slide_end">
</div>
</div>
How can I put an image as background in a div with the clip-path diagonally?
When I put more than one div, it gets defective in the diagonal lines, how could I do with more than one div following this example? http://jsfiddle.net/bn7mfj58/40/
– Wagner Martins Bodyboard
@Wagnermartinsbodyboard guy I gave an edited question, notice that now I put two Divs as the clip-path, including in the second div I put in another div, a P and a Span, and it’s all right... I believe it must be some other CSS that is affecting your div. Test it on a blank page to see what happens, or use the browser’s Inspect Devtools to see what’s going on. Anything speaks there
– hugocsl
@Wagnermartinsbodyboard turned out that just now I noticed that there was a link to Jsfiddle, I took a look at its layout, it seems that is ok... I don’t understand what you’d like to change?
– hugocsl
yes it’s right now, thank you :)
– Wagner Martins Bodyboard