在悬停时更改z-index

时间:2015-05-23 14:34:26

标签: css hover z-index tumblr

我正在尝试更改图片帖子的z-index,当您将鼠标悬停在图片上时,它会出现在前面,并覆盖大的白色文字。 不知道我在这里做错了什么......

http://hkumbrella.tumblr.com/

图片帖子css:

#post img {
width:100%;
z-index: -100;
}
#post img:hover {
opacity:1;
z-index: 100000 !important;

白色文字css(2014):

.subtitle2{
top:45%;
left:2%;
font-family:arimo;
font-weight:bold;
color: white;
text-transform:uppercase;
font-size:75px;
letter-spacing:-3px;
text-align:center;
position: fixed;
z-index:100;
color: #FFFFFF !important;
{block:Permalink}display:none;{/block:Permalink}
}

1 个答案:

答案 0 :(得分:1)

#wrapper' s z-index设置为高于100.

所有图片都在#wrapper div内,其z-index小于其兄弟.subtiles,所以即使您为{{1}的孩子设置了更高的z-index它不会出现在前面。

并且您在页面中的位置使用了#wrapper个倍数。你不是假设使用#post多个地方,而是使用类,它们只是为了那个。

相关问题