2017-08-08 243 views
0

其實我加了一些代碼到我的html頁面Html頁面大小iPhone屏幕

<meta name= "viewport" content= "width = device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> 

我認爲這將導致一個網頁,適用於所有設備

但結果是 Picture 1

雖然原來的是 Picture 2

而如果你會告訴我,我可以ch安格圖片的大小,其實我需要這個尺寸正好.. 因爲它是需要如上圖2

回答

1

好大小,也許你可以刪除:

<meta name= "viewport" content= "width = device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> 

因爲它不會讓用戶可以看到整個頁面。

+0

我應該添加什麼? – AxA

+1

@AxA我不確定你的其他代碼,但你應該使用相對寬度值,例如寬度:100%。 – Kumquat

+0

其實當我刪除它..它變得更好..但仍然沒有顯示一切! – AxA

0

嘗試

body {background-size: cover;} 

背景尺寸:蓋; - 爲您的背景圖像元素)

0

我會建議你使用CSS MediaQueries來做響應。這樣做

@media(min-width: your width in px;){ 
    // Your styles go here. 
    // here you can resize the widths and change other styles of your html 
    //elements 
    // when the device screen equals your defined min-width or above 

}

然後

@media(max-width: your width in px;){ 
    // Your styles go here. 
    // here you can resize the widths and change other styles of your html 
    //elements 
    // when the device screen equals your defined max-width or below 

}

希望這有助於。有關響應風格的更多信息,請訪問此鏈接https://www.w3schools.com/css/css_rwd_mediaqueries.asp