How to press the triangle and include the content on top of the white circle? I'm trying to find a solution to create a hero section with a background image that contains three overlay shapes as part of the image. On top of the overlay will be h1, p and btn. I've included a screenshot below showing how the design will look.
There are three overlays:
This is what I have so far. I've included a snippet below, and there's also a working version on Codepen. The circle is in the correct position in the lower left corner.
*{ padding: 0; margin: 0; box-sizing: border-box; } svg { width: 628; height: 628: } .element { position: relative; width: 100%; min-height: 628px; background: url(https://images-prod.healthline.com/hlcmsresource/images/AN_images/health-benefits-of-apples-1296x728-feature.jpg) no-repeat center top; background-size: cover; } .element:before{ content: ''; position: absolute; bottom: 0; left: 0; width: 100%;0 -webkit-clip-path: polygon(0 0, 0% 100%, 100% 100%); clip-path: polygon(0 0, 0% 100%, 100% 100%); } .circle-outer { cx: 200; cy: 720; fill: #fff; fill-opacity: 0.6; r: 420; w: 628; h: 628; } .circle-inner { cx: 200; cy: 720; fill: #fff; fill-opacity: 0.6; r: 400; } .hero-triangle { content: ''; position: relative; width: 100%; height: 100px; background: #fff; -webkit-clip-path: polygon(0 8%, 0% 100%, 100% 100%); clip-path: polygon(0 80%, 0% 100%, 100% 100%); z-index: 99; }
<div class="container"> <div class="element"> <div class="hero-content"> <h1>This belongs in circle</h1> <p>This belongs in circle too.</p> <button class="btn btn-primary">Learn more</button> </div> <svg viewbox width="1000" height="580" viewBox="0 0 100 100"> <circle class="circle-outer" /> <circle class="circle-inner" /> <polygon points="0,0 0,200 1000,200" style="fill:#fff;" /> </svg> </div> </div> <div class="container"> <h4>Body content must be positioned right underneath hero image for all widths.</h4>
Since circles are only decorative and do not add meaning, there is no need for them to be elements. They are sufficient as background images.
This is a simple code snippet that places a content element and gives it two background images, both with some transparency, using a radial gradient to make them round.