I am trying to create a button like this:
I dont know how to create a light moon shape over the top of the button.
This is still far off: Fiddle Demo.
.moon {
width: 50px;
height: 50px;
border-radius: 50%;
box-shadow: 15px 15px 0 0 green;
}
While the
box-shadow
approach is good, it can't produce an elliptical cut on the moon like in the image provided in question. The cut is circular and has the same radius as the container circle.If an elliptical cut is required then we could either use an pseudo-element (or) radial gradients.
Using Pseudo-element:
Using Radial Gradients:
With just a little
inset
you can style the shadow on top of the object.E.g. Crescent shape.
And, This is the button you want.
Here is a svg solution that uses a lineargradient.
Added the arrow because it looks more like a button that way :D