我想让元素看起来像这个图像
我已经尝试了很多在css中做这种影子,最后想想为什么不向社区询问它,无论是否可能.
我知道在box-shadow
盒子上的阴影.是否有类似的东西round-shodow
我希望它在css3没有任何图像.可能吗?如果是,那怎么可能呢?如果还不行
我知道box-shadow
,border-radius
所以请不要告诉我这件事情,再次检查它的不同影子
这至少是一个起点.您可以使用before(和after)伪元素.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;
}
Run Code Online (Sandbox Code Playgroud)
同样,它无论如何都不是一种完美的方法,但它能够在某种程度上完成你正在寻找的东西.