當PageSpeed Insights檢測到網(wǎng)頁內(nèi)容不適合在指定尺寸的視口內(nèi)水平顯示,而強制用戶水平移動網(wǎng)頁以查看所有內(nèi)容時,就會觸發(fā)此規(guī)則。
在桌面設備和移動設備上,用戶習慣于垂直(而非水平)滾動瀏覽網(wǎng)站,而強制用戶水平滾動或縮小以查看完整網(wǎng)頁會給用戶帶來很差的體驗。
在使用元視口代碼??? ? ???? ??? ? ?? ???? ???? ?? ? ??? ???? ??? ??? ??? ????. ?? ??, ???? ??? ? ??? ???? ???? ???? ???? ????? ???. ???? ?? ?? ? ??? ???? ???. ??? ?? ???? ???? ???? ??? ????.
不同的設備其屏幕尺寸會有很大的差異(例如,手機和平板電腦,甚至是不同款的手機),為此您應??? ??? ??,以便您的網(wǎng)頁能在許多不同的設備上正確呈現(xiàn)。然而,由于視口寬度(以CSS像素為單位)可能會有所不同,因此,您的網(wǎng)頁內(nèi)容不應依賴于能正常顯示的特定視口寬度。
div{width:360px;}
?? 320 CSS ??? iPhone? ?? ?? ?? ???? ??? ?? ??? ? ?? ?????. ???? ? ?(?:width:100%
)。同樣,您應注意使用較大的絕對定位值可能會導致元素超出較小屏幕的視口。?
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 the?Apache 2.0 ????. For details, see our?Site Policies.