Stack Overflow на русском Asked by Value on November 20, 2021
Пробовал через before, но с ним фон не получается. Плюс надо сделать полоску по краю
Вариант с использованием clip-path
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
[class*=section-] {
position: relative;
min-height: 100vh;
}
[class*=section-]::before,
.section-2::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
}
[class*=section-]::before {
min-height: 100vh;
background-repeat: no-repeat;
background-position: center top;
background-size: cover;
}
.section-1::before {
background-image: url(https://scx2.b-cdn.net/gfx/news/hires/2019/2-nature.jpg);
}
.section-2::before {
top: -48px;
min-height: calc(100vh + 48px);
background-color: #00f;
background-image: url(https://www.hopestandard.com/wp-content/uploads/2020/04/21333414_web1_200420-CRM-earth-day-EARTHDAY_1.jpg);
clip-path: polygon(calc(50% + 1px) 50px, calc(53% + 1px) 0, 100% 0, 100% 100%, 0 100%, 0 50px);
z-index: 1;
}
.section-2::after {
top: -50px;
min-height: calc(100vh + 50px);
background-color: #00f;
clip-path: polygon(50% 50px, 53% 0, 100% 0, 100% 100%, 0 100%, 0 50px);
}
<section class="section-1"></section>
<section class="section-2"></section>
Answered by soledar10 on November 20, 2021
Можно реализовать через 2 слоя наложенные друг на друга с отрицательным отступом:
Answered by Alexander on November 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP