Пример:
HTML:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<div class="row-box"> <div class="box"> <img src="/photo-1.jpg" alt=""> </div> <div class="box"> <img src="/photo-2.jpg" alt=""> </div> <div class="box"> <img src="/photo-3.jpg" alt=""> </div> <div class="box"> <img src="/photo-4.jpg" alt=""> </div> </div> |
CSS:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
.row-box { position: relative; } .box { display: block; width: 55%; position: relative; } .box img { width: 100%; height: 100%; object-position: 50% 50%; object-fit: cover; padding: 1% 0; } .box:nth-child(1) { clip-path: polygon(0 0, 97% 0, 82% 100%, 0 100%); } .box:nth-child(2) { clip-path: polygon(18% 0, 100% 0, 100% 100%, 3% 100%); left: 45%; position: absolute; top: 0; } .box:nth-child(3) { clip-path: polygon(0 0, 82% 0, 97% 100%, 0 100%); } .box:nth-child(4) { clip-path: polygon(3% 0, 100% 0, 100% 100%, 18% 100%); left: 45%; position: absolute; top: 50%; } |
Добавить комментарий: