2013-03-29 67 views
0

大家好!我很長一段時間的Web開發人員和設計師,但這個讓我傻眼了。我有一個關閉按鈕(這不是Bootstrap)。它顯示了優良的主頁上:如何正確定位關閉按鈕

enter image description here

但是,當我把相同的警報提交頁面上,它會向下移動關閉按鈕:

enter image description here

任何想法?這裏是我的HTML:

<div class="alert"> 
    <div class="alertContents"> 
     When you submit yo stuff, it comes up in the feed right away. 
     <div class="alertClose">&times;</div> 
    </div> 
</div> 

和CSS:

.alert { 
    width: 100%; 
    background-color: #DD7474; 
    font-family: 'Raleway', sans-serif; 
    font-size: 18px; 
    color: #FBFBFC; 
    margin: auto; 
    border-radius: 2px; 
    border-color: transparent; 
    border-width: 0px; 
    border-style: solid; 
} 
.alertContents { 
    padding-top: 4px; 
    padding-bottom: 4px; 
    padding-left: 10px; 
    padding-right: 10px; 
} 
.alertClose { 
    float: right; 
    width: auto; 
    height: auto; 
    color: #FBFBFC; 
    cursor: hand; 
} 

謝謝!

+2

你會介意設置一個小提琴嗎? – Brad

+0

你有沒有看過一個Web檢查器,看看提交頁面上是否有新的元素,並且可能將它移下來? – dev

+0

@vletech是的,我有。這很古怪。 –

回答

0

我會用:

position: absolute; 

,然後添加在

left: 250px; 

編輯:這些代碼添加到你的CSS ...喔,並回頭看發生了什麼事,也許你可以確保有一個:

clear: both; 

功能,如:

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

<br clear="all" /> 
+1

添加哪裏,使用哪裏?請編輯你的答案。 –

+0

@TehJamDude我嘗試使用絕對定位,但它搞砸了我的設計的資源。 –

+0

使用警報框前後的清除功能...也許您可以顯示更多的頁面,這將幫助我們找到問題。 – Fearless