CSS 堆叠不起作用。 z 索引的东西
所以我试图让一些东西堆叠在一起。首先,它有助于查看工作链接,您将看到问题:
http: //brownbox.net.au/clients/matchlessphotography/
现在我需要使用以下代码:
<div id="blogposts">
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
</div>
并将跨度直接放在图像的顶部、底部,这样当它在其中动画时jQuery 看起来像巨大的覆盖层向下滑动到略低于一半的大小,并且弹出帖子标题文本。
现在我快到了,但它不起作用。 我需要修复哪些 CSS 才能做到这一点?这是当前的CSS:
#blogposts{width:100%; height:auto; margin-left:8px; margin-top:20px; margin-bottom:30px; float:left; overflow:hidden; }
#blogposts a{border:1px solid #141414;-webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.7), inset 0px 0px 1px 1px rgba(255, 255, 255, 0.5);-moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.7), inset 0px 0px 1px 1px rgba(255, 255, 255, 0.5);box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.7), inset 0px 0px 1px 1px rgba(255, 255, 255, 0.5);-webkit-border-radius: 12px;
-moz-border-radius: 12px;border-radius: 12px; margin:10px 18px 9px 5px; width:197px; height:134px; display:block; float:left;}
#blogposts img{-webkit-border-radius: 11px;width:197px; height:134px; -moz-border-radius: 11px;border-radius: 11px; margin-top:0px; float:left;}
#blogposts span{z-index: 1000;float: left;bottom:-146px; width:177px; height:114px; background-image:url(images/misc/picoverlay.png); -moz-border-radius: 11px;border-radius: 11px; -webkit-box-shadow: inset 0px 0px 1px 1px rgba(255, 255, 255, 0.3);
-moz-box-shadow: inset 0px 0px 1px 1px rgba(255, 255, 255, 0.3);box-shadow: inset 0px 0px 1px 1px rgba(255, 255, 255, 0.3); padding:10px; font-size:18px; font-family:Georgia, "Times New Roman", Times, serif; font-style:italic; font-weight:bold; border:1px solid #141414;}
So I am trying to get some things to stack on top of each other. First of all it would help to see the working link and you'll see the issue:
http://brownbox.net.au/clients/matchlessphotography/
Now I need to use the folloing code:
<div id="blogposts">
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
<a><span><strong class="title_blog_mini_post">Post Title</strong></span><img src="images/wp-evential/sample-blog.jpg" width="197" height="134" /></a>
</div>
and have the span sitting directly on top of the image, at the bottom so that when it animates within the jQuery it looks like the great overlay slides down to just under half the size and the post title text pops up.
Now I am almost there but its not working.
What CSS do I need to fix to do this? Here is the current css:
#blogposts{width:100%; height:auto; margin-left:8px; margin-top:20px; margin-bottom:30px; float:left; overflow:hidden; }
#blogposts a{border:1px solid #141414;-webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.7), inset 0px 0px 1px 1px rgba(255, 255, 255, 0.5);-moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.7), inset 0px 0px 1px 1px rgba(255, 255, 255, 0.5);box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.7), inset 0px 0px 1px 1px rgba(255, 255, 255, 0.5);-webkit-border-radius: 12px;
-moz-border-radius: 12px;border-radius: 12px; margin:10px 18px 9px 5px; width:197px; height:134px; display:block; float:left;}
#blogposts img{-webkit-border-radius: 11px;width:197px; height:134px; -moz-border-radius: 11px;border-radius: 11px; margin-top:0px; float:left;}
#blogposts span{z-index: 1000;float: left;bottom:-146px; width:177px; height:114px; background-image:url(images/misc/picoverlay.png); -moz-border-radius: 11px;border-radius: 11px; -webkit-box-shadow: inset 0px 0px 1px 1px rgba(255, 255, 255, 0.3);
-moz-box-shadow: inset 0px 0px 1px 1px rgba(255, 255, 255, 0.3);box-shadow: inset 0px 0px 1px 1px rgba(255, 255, 255, 0.3); padding:10px; font-size:18px; font-family:Georgia, "Times New Roman", Times, serif; font-style:italic; font-weight:bold; border:1px solid #141414;}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Z-index 只会影响位置设置为“绝对”或“固定”的对象。
默认情况下,位置设置为“相对”,并且将简单地忽略“z-index”CSS 属性。
Z-index will only affect an object with a position set to "absolute" or "fixed".
By default, a position is set to "relative" and will simply ignore the "z-index" css property.