亚洲永久精品免费ww52com,色777狠狠狠综合伊人,中文在线观看免费网站,国产特级毛片AAAAAAA高清,9191精品国产费久久,十八破女处WWW视频,欧美一区二区三区久久综合,日夜夜天天人人综合网,91热久久免费频精品黑人99,国产99久久九九精品无码,日本精品综合精品天堂中文,天天国产综合永久精品日韩,国产私密网站入口,无码精品人妻一区二区三区漫画 ,色噜噜人妻av中文字幕,911亚洲精品永久入口

Configure Viewport

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

當(dāng)PageSpeed Insights檢測(cè)到您的網(wǎng)頁(yè)未指定視口,或者指定的視口不適合不同設(shè)備時(shí),就會(huì)觸發(fā)此規(guī)則。

概覽

Viewport can control how web pages are displayed on mobile devices. If no viewport is specified, the mobile device renders the Web page to the width of a typical desktop screen and adjusts the Web page to fit the screen size. By setting the viewport, you can control the width and scaling of web pages on different devices.

?
Left: Web page with no meta-viewport specified.
Right: A Web page that specifies a viewport that matches the width of the device.

建議

經(jīng)過(guò)優(yōu)化可在移動(dòng)設(shè)備上正常顯示的網(wǎng)頁(yè)應(yīng)在文檔標(biāo)頭中包含元視口,指定如下內(nèi)容:width=device-width, initial-scale=1.

其他信息

術(shù)語(yǔ):

  • Hardware pixel: The physical pixel of the display. For example, the iPhone 5 comes with a screen with 640 horizontal hardware pixels.
  • Device-independent pixels (dip): under normal visual distance, it conforms to uniform參考像素的設(shè)備像素比例,此像素在所有設(shè)備上大小幾乎相同。iPhone 5的設(shè)備無(wú)關(guān)像素寬度為320。
  • CSS像素:用于頁(yè)面布局的單位,由視口控制。樣式的像素尺寸(例如width: 100px) is specified in units of CSS pixels. The ratio of CSS pixels to device-independent pixels is the scale factor or zoom level of the web page.

Desktop Web Pages on Mobile Devices

如果網(wǎng)頁(yè)未指定視口,則移動(dòng)瀏覽器將以800至1024 CSS像素的后備寬度呈現(xiàn)該網(wǎng)頁(yè)。系統(tǒng)會(huì)調(diào)整網(wǎng)頁(yè)的比例系數(shù),以便網(wǎng)頁(yè)與顯示屏大小相協(xié)調(diào),這就要求用戶(hù)在與網(wǎng)頁(yè)互動(dòng)之前先進(jìn)行縮放。

元視口代碼

元視口代碼會(huì)為瀏覽器提供指示,說(shuō)明如何控制網(wǎng)頁(yè)的尺寸和比例,且文檔標(biāo)頭中應(yīng)包含此代碼。

固定寬度的視口

The viewport can be set to a specific width, such aswidth=320width=1024。雖然我們不建議這樣做,但這能有效確保具有固定尺寸的網(wǎng)頁(yè)能按預(yù)期顯示。

響應(yīng)視口

Use meta-viewport valueswidth=device-width可指示網(wǎng)頁(yè)與屏幕寬度(以設(shè)備無(wú)關(guān)像素為單位)進(jìn)行匹配。這樣,網(wǎng)頁(yè)就可以重排內(nèi)容以匹配不同的屏幕尺寸。

有些瀏覽器(包括iOS和Windows Phone)在旋轉(zhuǎn)為橫向模式時(shí)會(huì)保持網(wǎng)頁(yè)寬度不變,并且會(huì)縮放(而非重排)網(wǎng)頁(yè)以填充屏幕。添加屬性initial-scale=1均可指示瀏覽器將CSS像素與設(shè)備無(wú)關(guān)像素的比例設(shè)為1:1(而不用考慮設(shè)備的屏幕方向),并且可讓網(wǎng)頁(yè)利用整個(gè)橫向?qū)挾取?/p>

Contrast
Left: iPhone 5 rotateswidth=device-width,橫向?qū)挾茸優(yōu)?20像素。
右圖:iPhone 5旋轉(zhuǎn)width=device-width, initial-scale=1The lateral width becomes 568 pixels.

Web pages must adapt to different widths to use the response viewport. For suggestions, please refer to our調(diào)整內(nèi)容的尺寸,使其符合視口設(shè)置的建議。

其他注意事項(xiàng)

Please avoid usingminimum-scale、maximum-scaleuser-scalable

您可以設(shè)置縮放級(jí)別的下限和上限,也可以徹底禁止用戶(hù)縮放視口。這些選項(xiàng)會(huì)對(duì)可訪(fǎng)問(wèn)性造成負(fù)面影響,因此一般情況下您應(yīng)避免使用這些選項(xiàng)。

@ viewport

Although meta-viewport code is widely supported, it is not yet a formal standard. This action will act as aCSS Device Adaptation規(guī)范的一部分納入CSS。本規(guī)范最終定稿并廣泛實(shí)施之前,作者應(yīng)繼續(xù)使用元視口代碼,從而確保兼容性。您可以單獨(dú)使用,也可以與相應(yīng)的@viewport樣式搭配使用。

Resources:

Except as other written, the content of this page is licensed under theCreative 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