国产欧美日本一区二区三区免费_在线午夜日韩_青久视频_91麻豆国产精品91久久久_天天干天天插天天射_天天操夜夜操B天天拍_亚洲精品第一永久地址911_色一情一乱一伦一区二区三区 _精品入口免费_中文成人精品视频久久视频_桃色播播_91嫩草香蕉国产线懂你的网站_日产国产亚洲A片无 码_久久精彩免费视频_永久精品大片www._精品国产成人_日日碰狠狠添天天爽无码av

Resize content to fit viewport settings

Dec 22, 2015
PageSpeed ??Insights
0
On this page

當(dāng)PageSpeed Insights檢測到網(wǎng)頁內(nèi)容不適合在指定尺寸的視口內(nèi)水平顯示,而強(qiáng)制用戶水平移動網(wǎng)頁以查看所有內(nèi)容時(shí),就會觸發(fā)此規(guī)則。

概覽

On desktop and mobile devices, users are accustomed to scrolling through websites vertically (rather than horizontally), and forcing users to scroll horizontally or zoom out to view the full web page can bring poor experience to users.

In use元視口代碼開發(fā)移動網(wǎng)站的過程中,您往往會在無意中創(chuàng)建并不適用于指定視口的網(wǎng)頁內(nèi)容。例如,如果在視口中顯示大于視口寬度的圖片,會迫使用戶水平滾動該視口。您應(yīng)調(diào)整此內(nèi)容,使其符合視口的寬度。這樣一來,用戶就不用水平滾動視口了。

Recommendations

Screen sizes vary greatly from device to device (for example, cell phones and tablets, or even different models of cell phones), so you shouldConfigure the corresponding viewport,以便您的網(wǎng)頁能在許多不同的設(shè)備上正確呈現(xiàn)。然而,由于視口寬度(以CSS像素為單位)可能會有所不同,因此,您的網(wǎng)頁內(nèi)容不應(yīng)依賴于能正常顯示的特定視口寬度。

  • 避免為網(wǎng)頁元素設(shè)置較大的絕對CSS寬度(例如,div{width:360px;}), because this may cause the element to appear too wide on narrower devices such as the iPhone, which has a width of 320 CSS pixels. Consider using relative width values such as,width: 100%)。同樣,您應(yīng)注意使用較大的絕對定位值可能會導(dǎo)致元素超出較小屏幕的視口。
  • 如有必要,您可以使用CSS媒體查詢為較小或較大屏幕應(yīng)用不同的樣式。這篇HTML5 Rocks Articles提供了有關(guān)如何實(shí)現(xiàn)這一目標(biāo)的進(jìn)一步建議。
  • 針對圖像,請參閱這篇文章,其中提供了有關(guān)如何在網(wǎng)頁呈現(xiàn)期間且在不產(chǎn)生不必要網(wǎng)頁重排的情況下提供相應(yīng)大小圖片的完整概覽。

?

Except as otherwise noted, the content of this page is licensed under the?Creative Commons Attribution 3.0 License, and code samples are licensed under theApache 2.0 License. For details, see our?Site Policies.

Nickname*:
E-mail*:
Rate*:
Comments*:

If you need to get in touch with us, here are our contact details

If you need to get in touch with us, here are our contact details
Contact number
Contact email
WeChat Contact
Jieying Network
QQ