1
我已經爲該網站做了一些媒體查詢http://www.domda.se 問題是,當我在iphone上查看網站時,#middle和#bottom中的backgroundcolours不起作用。問題開始時,我添加-1邊距,以防止divs之間的差距。我試圖刪除負邊距,看看是否有幫助,但它沒有奏效。在div中的背景顏色不能在iphone中工作
我做錯了什麼?
我已經爲該網站做了一些媒體查詢http://www.domda.se 問題是,當我在iphone上查看網站時,#middle和#bottom中的backgroundcolours不起作用。問題開始時,我添加-1邊距,以防止divs之間的差距。我試圖刪除負邊距,看看是否有幫助,但它沒有奏效。在div中的背景顏色不能在iphone中工作
我做錯了什麼?
在這個規則中,這個媒體查詢
@media only screen and (max-width: 480px), screen and (max-device-width: 480px),
screen and (max-width: 600px) {
/* ...some other stuff here... */
#middle {
background: #00ffff;
float: none;
margin: -1px 0 0 0;
width: 100%;
clear: both;
}
/* ...some more stuff here... */
你可以嘗試添加overflow:hidden;
?另外,在#bottom
:
#bottom {
background: #fff;
float: none;
margin: -1px 0 0 0;
width: 100%;
clear: both;
overflow:hidden; /* ADD THIS PROPERTY ON BOTH */
}
我認爲這個問題是您要移除float
,因此容器不會......包含的內容了。
吉皮! (Hooray,瑞典語)。有效。非常感謝。 – fortes
非c'èdi che @fortes - 歡迎您來意大利語;) – Giona