Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How achieve rounded shadow behide a rounded element using css3

Tags:

html

css

i want to make a element look like in this image

Round shadow on element

i have tried a a lot to do this kind of shadow in css, and finally think why not ask to community about it, whether its possible or not.

i know in box-shadow means shadow on box. is there something like round-shodow

i want it in css3 without any images. is it possible? if yes then how is it possible? if no than ok.

i know box-shadow and border-radius very so please don't tell me about that things, check again its different kind of shadow

like image 233
dev.meghraj Avatar asked Jun 05 '26 12:06

dev.meghraj


1 Answers

Here's a starting point at least. You can use the before (and after) pseudo elements. http://jsfiddle.net/FHLJM/

div {
    background-color: #f00;
    border-radius: 50%;
    height: 250px;
    width: 250px;
    margin: 30px auto;
    position: relative;
    z-index: 1;
}
div:before {
    content: '';
    height: 150px;
    width: 250px;
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#000), to(#fff));;
    position: absolute;
    top: 100px;
    right: 50px;
    -webkit-transform: rotate(45deg);
    z-index: -1;
}
div:after {
    content: '';
    height: 100%;
    width: 100%;
    border-radius: 50%;
    background: #f00;
    position: absolute;
    z-index: 1;
}

Again, it's not a perfected method by any means, but it is able to accomplish what you're looking for to some degree.

like image 193
Chad Avatar answered Jun 08 '26 02:06

Chad