2015-02-10 25 views
-1

我有這樣的HTML代碼上面:#top返回定位頁腳

<div id="footer"> 

     <div id="container">      

        <div id="top"></div> 


     </div> 


<div id="footer2"> 
    <div id="meniu"> 
    <?php wp_nav_menu(array('sort_column' => 'menu_order', 'container_class' => 'menu-header')); ?> 
    </div> 
    <div id="copyright"> 
    <h1 id="text_c">© Codoban.com All rights reserved</h1> 
    </div> 
</div> 
    </div> 


</body> 

這是CSS代碼:

#top { 
    margin: auto; 
    width: 400px; 
    height: 38px; 
    background: url(img/DESPRE-NOI.png) no-repeat; 

} 



#footer2 
{ 
    text-align: center; 
    border:0px solid #fff; 
    width: 100%; 
    background:url(img/BODY-MENU.png); 
margin:0px; 
bottom:0px; 
position: fixed; 

} 

我想要做的就是對準#top返回在#footer之上,如下圖所示。 enter image description here

如果你申請margin-top: X value爲特定的分辨率定位...如果我移動筆記本電腦看起來不好。

我嘗試了所有我們知道的解決方案......即使是@media查詢,但仍然無法正常工作。

你能幫我解決這個問題嗎? 我需要編輯HTML代碼?

在此先感謝!

+0

爲什麼不把#top放在#footer2中? – SKeurentjes 2015-02-10 08:56:55

回答

0

設置絕對位置爲#top,bottom: 80px只是一個例子,不知道底部需要什麼確切的位置。

#top {position: absolute; bottom: 80px; left: 50%; margin-left: -200px}