我有一個問題,我使用的顏色塊就像一個按鈕,它很好地位於Firefox和IE中,但由於Safari的某些原因,坐在下面我希望坐的位置見圖)。CSS元素在Safari中低於預期位置
任何指針,以什麼我做錯了會,因爲我已經與這擺弄一段時間,似乎無法得到它的工作是極大的讚賞(?)
的(我的想法是)相關的CSS是:
//the element that represents the button that is floating
//too low in safari:
#addplacebtn {
text-align: center;
margin-top: 0em;
margin-bottom: 0em;
display: inline-block;
width: 35px;
float: right;
background-color: #226083;
}
//the element that is containing the problematic element
#edit-addplacebtn {
height: 45px;
width: 35px;
top: 5px;
}
//the element containing the above element
.tbrow {
height: 35px;
width: 285px;
margin-bottom: 5px;
margin-top: 5px;
}
你的Html代碼是什麼? – 2012-04-26 11:12:18
張貼在jsfiddle – 2012-04-26 11:51:39
我的猜測是,由於某種原因,該按鈕不太適合你留下的差距。除此之外,'#addplacebtn'上的'display:inline-block;'和'float:right;'都是。 'float'意味着'display'將不起作用。也許試試'float:left;'?另外,除非你已經定位了'#edit-addplacebtn','top'將不起作用。 – 2012-04-26 14:22:46