Is there a good way to make this with HTML/CSS? Basically a div, that has a circle "bump" on the edge. That part is easy using pseudo classes, but my problem is making the drop shadow treat it as part of the shape.
When I apply a drop shadow the circle separately, it doesn't work reliably. I know there's a way to do this..but I am unsure what the browser support is.
What would you guys recommend is the best way to tackle this? Thanks!
You can come close to this with a bunch of CSS. See this JSFiddle for a live example. However, there are disadvantages:
position: relative
(or absolute
)The CSS:
div {
margin: 100px;
width: 100px;
height: 100px;
box-shadow: 0 0 10px black;
border-radius: 10px;
position: relative;
}
div:before {
display: block;
content: "";
width: 40px;
height: 40px;
position: absolute;
left: -20px;
top: 30px;
border-radius: 20px;
box-shadow: 0 0 10px black;
clip: rect(-10px, 20px, 50px, -10px);
}
To be honest, an image, if you want it to make it work on mozilla, safari and chrome. It can be done with css3 but I wont recommend it.
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