I'm trying to create the following layout in CSS.
This would usually be easy to do, however because the background is an image (illustrated in my image as a gradient), I can't simply add a absolute positioned div at the top and color the 'cut away'. I've been struggling to work out how to do this for the last few hours.
I've looked up some examples using the ::before
and ::after
pseudo selectors, however can't work out how do it while keeping the border radius on the main content div (blue).
<div class="content">
<div class="header">
<a class="left" href="#">LINK 1</a>
<!--
Stuck with how to position this so it clips
<img class="logo" src="https://placehold.it/100x100">
-->
<a class="right" href="#">LINK 2</a>
</div>
<p>Some text content</p>
.content {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 20px;
background-color: blue;
height: 300px;
width: 400px;
padding: 20px;
}
.header {
position: relative;
top: -50px;
padding: 0 20px;
}
.header .right {
float: right;
}