Hello. I got a template whose sections are not rectangular. I tried to cut it, but I didn’t have it all very well (the code below) and tried to do everything with the help of cliparts. In general, I am at an impasse. Tell me how to properly such sections. Code with after
* { box-sizing: border-box; } .wrapper{ max-width: 970px; } header { width: 100%; min-height: 1086px; background-image: url(http://s020.radikal.ru/i718/1610/53/2e62f2d87942.jpg); background-repeat: no-repeat; background-size: contain; } .spiker { width: 100%; min-height: 1371px; background-image: url(http://s017.radikal.ru/i416/1610/f3/0f627944ef70t.jpg); background-repeat: no-repeat; background-size: contain; } .spiker::after { width: 100%; height: 163px; top: 20px; position: absolute; background-image: url(http://s45.radikal.ru/i110/1610/c3/9837344ef991t.jpg); background-repeat: no-repeat; background-size: contain; content: ''; } <div class="wrapper"> <header> </header> <section class="spiker"> </section> </div> Clipart code
body { width: 80%; margin: 0 auto; overflow: hidden; } header{ width: 280px; height: 280px; background: red; -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 75%); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 75%); } .section1{ width: 280px; height: 280px; background: #1e90ff; -webkit-clip-path: polygon(0 0, 100% 30%, 100% 100%, 0 75%); clip-path: polygon(0 0, 100% 30%, 100% 100%, 0 75%); } <body> <header></header> <section class="section1"></section> </body> 
clip-pathsupported, would it not be better to usetransform:rotatewith a pre-rotated image (or usetransform:skew, return the image itself inside withtransform:skewin the opposite direction and trim it all withoverflow:hidden) ? - Surfin Bird