在过去的一个小时里,我一直在试图弄清楚如何使用盒子阴影来提升 div 的左角。这就是我想要完成的,第 3 号:http: //www.paulund.co.uk/creating-different-css3-box-shadows-effects。我知道有些帖子向您展示了如何做到这一点,但我已经尝试了所有方法,但似乎没有任何效果,这让我相信我的代码有问题。我将不胜感激找到我的错误的任何帮助,谢谢。
html
<img class='lazy image effect3' src='http://pearlsquirrel.com/images/lazyload.png' original-src='http://pearlsquirrel.com/profilethumbnails/$thumbnail' width='180' height='180' alt='PearlSquirrel'/>
css
.image {
-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;
position:relative;
padding:2px;
background:#fcfcfc;
box-shadow: 0px 0px 1px 1px rgba(0,0,0,0.2);
-o-box-shadow: 0px 0px 1px 1px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 0px 1px 1px rgba(0,0,0,0.2);
}
.effect3
{
position: relative;
}
.effect3:before
{
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 10px;
width: 50%;
top: 80%;
max-width:300px;
background: #777;
-webkit-box-shadow: 0 15px 10px #777;
-moz-box-shadow: 0 15px 10px #777;
box-shadow: 0 15px 10px #777;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
}
这是我在这里的示例:http://jsfiddle.net/j4naA/