您可以像这样使用径向渐变:
#leftshadow
{
margin-left: 10px;
height: 200px;
width: 20px;
border-left:1px solid #ebebeb;
border-left:1px solid rgba(0,0,0,0.4);
background:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.3)),to(rgba(0,0,0,0)));
-webkit-mask-box-image:-webkit-gradient(linear,left top,right bottom,color-stop(0.0,rgba(0,0,0,0)),color-stop(0.5,rgba(0,0,0,.8)),color-stop(1.0,rgba(0,0,0,0)));
background-image:-moz-radial-gradient(left,ellipse farthest-side,rgba(0,0,0,.3),rgba(0,0,0,0));
}
jsFiddle在这里
不同的调整在这里
原始答案
如果你需要一个“简单”的嵌入阴影,你也可以像这样实现:
#leftshadow
{
-webkit-box-shadow: inset 5px 0px 5px -2px rgba(0,0,0,0.4);
-moz-box-shadow: inset 5px 0px 5px -2px rgba(0,0,0,0.4);
box-shadow: inset inset 5px 0px 5px -2px rgba(0,0,0,0.4);
}
jsFiddle在这里