The above image is what i'm trying to create but am having some difficulties with the oval shape. An explanation:
I've tried and failed many times with a radial gradient - I was able to get a circle cut out but couldn't work out how to make it oval and then couldn't get the linear gradient to work. See code:
.circle {
height: 10em;
background: radial-gradient(circle 50px at 50% 100%, transparent 50px, rgba(84, 82, 94, 0.8) 50px);
background: -webkit-radial-gradient(50% 100%, circle, transparent 50px, rgba(84, 82, 94, 0.8) 50px);
}
When the cutout shape and the gradient is sorted, the logo will be positioned over the top.
Any suggestions or jsfiddle solutions would be appreciated, thanks!
EDIT: jsfiddle here
EDIT 2: Have solved the problem by changing the design slightly, thanks to those who replied. I wrote some jquery to solve this - when the coloured area scrolls out of view the oval border and header border will pick up the colour of the top section, instead of the transparency.
You can start from this Running Demo
Note: I've added a small animation to change the background color just to clear that the space between the island and the div with the cutout is really transparent.
HTML
<div class="cutout">
<div class="island">
<div id="circleText">Circle Text </div>
</div>
</div>
CSS
.cutout {
height: 10em;
background: radial-gradient(ellipse 200px 150px at 50% 100%,
transparent 100px, #555 50px);
position: relative;
}
.island {
position: absolute;
left: calc(50% - 150px);
bottom: -50%;
width: 300px;
background: radial-gradient(ellipse 200px 150px at 50% 50%,
silver 90px, rgba(0, 0, 0, 0) 50px);
height: 10em;
}
.island > div {
position: absolute;
left: 80px;
right: 80px;
top: 30px;
bottom: 30px;
background: rgba(fff, 0, 0, 0.2);
padding: 5px;
text-align: center;
}
#circleText {
padding-top: 30px;
font-size: 1.5em;
}
Try this one:
background: radial-gradient(ellipse at 50% 100%, transparent 50px, rgba(84, 82, 94, 0.8) 50px);
jsfiddle here
Try this: http://css-tricks.com/the-shapes-of-css/
position it absolutely on top of the other parts of the menu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With