我有一个非常简单的滑块,我正在尝试在此链接http://www.paulund.co.uk/creating-different-css3-box-shadows-effects上为幻灯片中的所有图像实现#5。我运气不好!我根本无法得到任何东西。感谢您提前提供任何帮助。
幻灯片css:
.blueberry { margin: 0 auto; padding-bottom:25px; width:auto;}
.blueberry .slides {
display: block;
position: relative;
overflow: hidden;
}
.blueberry .slides li {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
.blueberry .slides li img {
display: block;
width: 100%;
max-width: none;
}
.blueberry .slides li.active { display: block; position: relative; }
.blueberry .crop li img { width: auto; }
.blueberry .pager {
height: 40px;
text-align: center;
}
.blueberry .pager li { display: inline-block; }
.blueberry .pager li a,
.blueberry .pager li a span {
display: block;
height: 4px;
width: 4px;
}
.blueberry .pager li a {
padding: 18px 8px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
-o-border-radius: 6px;
-ms-border-radius: 6px;
-khtml-border-radius: 6px;
border-radius: 6px;
}
.blueberry .pager li a span {
overflow: hidden;
background: #c0c0c0;
text-indent: -9999px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-o-border-radius: 2px;
-ms-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
}
.blueberry .pager li.active a span {
background: #404040;
}
.shadow:before, .shadow:after
{
z-index: -1;
position: absolute;
content: "";
bottom: 25px;
left: -25px;
width: 50%;
top: 80%;
max-width:400px;
background: #777;
-webkit-box-shadow: 0 35px 20px #777;
-moz-box-shadow: 0 35px 20px #777;
box-shadow: 0 35px 20px #777;
-webkit-transform: rotate(-8deg);
-moz-transform: rotate(-8deg);
-o-transform: rotate(-8deg);
-ms-transform: rotate(-8deg);
transform: rotate(-8deg);
}
.shadow:after {
-webkit-transform: rotate(8deg);
-moz-transform: rotate(8deg);
-o-transform: rotate(8deg);
-ms-transform: rotate(8deg);
transform: rotate(8deg);
right: 10px;
left: auto;
}
HTML:
<div class="blueberry">
<ul class="slides shadow">
<li><img src="images/avatar.jpg" /></li>
<li><img src="images/ironman.jpg" /></li>
<li><img src="images/tron.jpg" /></li>
<li><img src="images/greenhornet.jpg" /></li>
</ul>
</div>
答案 0 :(得分:0)
您需要将“active”类应用于其中一个li以查看任何内容。然后返回该站点并查看阴影效果的前/后代码。目前它不在你的CSS中的任何地方
好的,很酷。看看Wolf的jsfiddle,注意阴影正在应用于h3,而不是图像或li本身。如果你把它应用到li,你会得到一些非常时髦的怪异。
答案 1 :(得分:0)
这里我修改了类box
.box {
width:70%;
height:200px;
background:#FFF;
margin:40px auto;
background-image:url('http://unleashthefanboy.s3.amazonaws.com/wp-content/uploads/2012/05/MARK2.jpg');
background-color:#cccccc;
background-size:100%;
}