2016-04-29 56 views
-3

我一直在嘗試糾正一段時間沒有結果。一個固定的菜單欄在頁面頂部,完美運行。現在嘗試將絕對定位的頁面標題設置爲「主頁」,菜單欄的右上角正常工作時,我直接從PC打開它,但是當我在服務器上打開它時,標題顯示在菜單下方和頁面左側。在服務器上被忽略絕對定位

我已經玩過固定和相對定位,當從我的PC啓動時相對再次工作,但在服務器上的結果相同。

我希望我已經提供了足夠的正確的代碼,但讓我知道。

感謝您的建議和幫助。

.fixed-menu 
 
{ 
 
z-index:999; 
 
position: fixed; 
 
height: 10px; 
 
width:inherit; 
 
left:auto; 
 
right:auto; 
 
} 
 

 
.page-title 
 
{ 
 
position:absolute; 
 
top:10; 
 
right:10; 
 
color:#000; 
 
font-weight:600; 
 
} 
 

 
#cssmenu { 
 
    line-height: 1; 
 
    border-radius: 5px 5px 0 0; 
 
    -moz-border-radius: 5px 5px 0 0; 
 
    -webkit-border-radius: 5px 5px 0 0; 
 
    background: #001a00; 
 
    background: -moz-linear-gradient(top, #00FFFF 0%, #001a00 100%); 
 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #00FFFF), color-stop(100%, #001a00)); 
 
    background: -webkit-linear-gradient(top, #00FFFF 0%, #001a00 100%); 
 
    background: -o-linear-gradient(top, #00FFFF 0%, #001a00 100%); 
 
    background: -ms-linear-gradient(top, #00FFFF 0%, #001a00 100%); 
 
    background: linear-gradient(to bottom, #00FFFF 0%, #001a00 100%); 
 
    border-bottom: 2px solid #9900FF; 
 
    width: auto; 
 
} 
 
#cssmenu:after, 
 
#cssmenu ul:after { 
 
    content: ''; 
 
    display: block; 
 
    clear: both; 
 
}
<div id="container"> 
 

 
<div class="fixed-menu"> 
 
\t <div id='cssmenu'> 
 
<ul> 
 
    <li><a href='#'><span>Home</span></a></li> 
 
    <li class='has-sub'><a href='#'><span>Share with the Group</span></a> 
 
\t \t <ul> 
 
\t \t <li class='last'><a href='internet.html'><span>From the Internet</span></a></li> 
 
\t \t <li class='last'><a href='athome.html'><span>From Your Computer</span></a></li> 
 
\t \t </ul> 
 
    </li> 
 
    <li><a href='hide.html'><span>Hide Group in Timeline</span></a></li> 
 
    <li><a href='nonotices'><span>Turn off Notifications</span></a></li> 
 
    <li><a href='members.html'><span>Add Members</span></a></li> 
 
    <li class='last'><a href='other.html'><span>Other</span></a></li> 
 
</ul> 
 
\t </div> 
 
\t \t \t <div class="page-title">Home Page</div> 
 
</div> 
 

 
<div class="clear-menu"></div> 
 

 
\t <div id="banner"> 
 

 
\t \t <div class="image"><img src="images/banner.jpg" width="900" height="349" title="Just for Laughs FB Group" border="0" /></div> 
 
\t \t <div class="title"><p>Just for Laughs</p></div> 
 
\t </div> 
 
<!-- ********** Banner Table Ends ********** --> 
 
<h1>Future Home of Just for Laughs FB Group</h1> 
 
</div>

+4

夥計們,鏈接中的圖像是NSFW。所以點擊它時要小心。 –

+0

開始時,「..page-title」的定位值是無單位的。 **驗證!** –

+0

對不起,我已經替換了圖像。 –

回答

0

添加到PX。第標題

.page-title 
{ 
position:absolute; 
top:10; 
right:10; 
color:#000; 
font-weight:600; 
} 
+0

給任何單位只適用於0,但不適用於任何其他號碼;) – Daniel

1

的頂部和右側定義正如我在這裏看到.page-title選擇,你必須使用一個單位來指定topright值例如:

.page-title 
{ 
    position:absolute; 
    top:10px; 
    right:10px; 
    color:#000; 
    font-weight:600; 
} 
+0

我已經調整了代碼,建議使用相同的結果。確定從PC,但仍然沒有在服務器上工作。 –

+0

再試一次。並且感謝你確實在工作。 –

+0

好吧,很高興它有幫助!別客氣 –

相關問題