2015-08-17 109 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