2015-08-17 75 views
0

我能够在我的Tumblr博客中编写固定头文件:http://artsypancake.tumblr.com/Tumblr:内容重叠固定标题?

标题在我的主页上正常工作,它与所有帖子重叠,这是预期的效果。但是,当我向下滚动时,我的自定义页面上的内容会在我的标题上运行。示例:http://artsypancake.tumblr.com/aboutme这令人困惑,它只发生在我制作的自定义页面中。

此外,我已经尝试增加标题的z-index,但它不会对自定义页面帖子产生任何影响。

下面是组头的CSS:

#topbar { 
z-index: 999; 
position: fixed; 
top: 0; 
left: 0; 
width: 100%; 
height: 27px; 
text-align: center; 
background-color: {color:Top Bar Background}; 
border-bottom: 3px solid {color:Top Bar Border}; 
} 

#topbar a { 
position: relative; 
font-family: text me one; 
color: {color:Top Bar Text}; 
background-color: {color: Top Bar Text Background}; 
letter-spacing: 1px; 
font-size: 9px; 
text-transform: uppercase; 
margin: 5px; 
padding: 5px; 
top: 7px; 
-webkit-transition: all 0.2s ease-in-out; 
-moz-transition: all 0.2s ease-in-out; 
-o-transition: all 0.2s ease-in-out; 
-ms-transition: all 0.2s ease-in-out; 
transition: all 0.2s ease-in-out; 
} 

#topbar a:hover { 
background-color: {color:Top Bar Text Hover BG}; 
color: {color:Top Bar Text Hover}; 
} 

CSS的内容:

.entry { 
position: relative; 
width: 500px; 
background-color: {color:Entries}; 
border: 2px solid {color:Entries Border}; 
margin-bottom: -30px; 
margin-top: 55px; 
margin-left: 400px; 
padding: 10px; 
word-wrap: break-word; 
} 

而对于标题和条目,这是对彼此相邻两个HTML:

<div id="topbar">...</div></div> 
<div class="entry">...</div></div> 

谢谢!

回答

0

彗星!问题在于,在您的自定义页面上,标题是.leftbg的子标题,而在主页上,标题是其他所有内容的对等项。 #topbar的z-index为999,但只影响其同伴(在本例中为.entries)。要查看此信息,请在自定义页面上检查元素#topbar,然后在主页上查看。在html中,标题可以与其他条目一起放置(以便z-index:999将标题放在其他内容的上方),也可以作为默认z-index为“auto”的.leftbg的子标题放置。

要解决此问题,请将z-index:1;添加到#leftbg。虽然你可以将.entry的z-index更改为-1,但由于我对tumblr的布局不是非常熟悉,因此可能会破坏别的东西。

另一方面,我想建议在您的音乐播放器上禁用自动播放功能。当用户不希望玩某些东西时,自动播放内容通常不是一件好事。

+1

非常感谢!这完全是我的一天! (令人沮丧的是,这件事很简单,但我不能弄明白!)再次感谢你!我也禁用了自动播放。 :) – Comet