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

Use legible font sizes

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

當PageSpeed Insights檢測到網(wǎng)頁上的文字太小而難以辨認時,就會觸發(fā)此規(guī)則。

概覽

You can use the followingFour commonly used unitsTo specify the page font size: pixels (px), dots (pt), em (em), and percentages (%).

  • 像素即“CSS像素”,會因設備尺寸和密度而異。
  • 點是相對于像素而定義的。一個像素是0.75點*.
  • EM and Percentage are "relative" units: These are relative to the use of font sizes and attributes. 1 EM equates to 100%.

?

*請參見其他說明。

此外,ViewportWill affect how fonts are scaled on mobile devices. Web pages that do not have a properly configured viewport will be scaled down on mobile devices, which often results in small and illegible text on the page.

建議

首先,Configure ViewportTo ensure that the font will be scaled as expected in each device. After configuring the viewport, implement the following additional recommendations:

?

  1. 使用16 CSS像素的基準字體大小。根據(jù)要使用的字體的屬性按需調整字體大小。
  2. 使用相對于基準字體的字體大小定義排版比例。
  3. 每行文字的字符之間需要留出一定的垂直空間,而且還可能需要根據(jù)每種字體進行不同的調整。我們通常建議您使用瀏覽器默認的行高1.2em。
  4. 限制所用字體的數(shù)量以及排版比例:過多字體和字體大小會導致網(wǎng)頁布局雜亂且過于復雜。

For example, the following CSS code snippet defines a baseline font size of 16 CSS pixels, where the font size is defined as 75% of the baseline font size (i.e. 12 CSS pixels) in the CSS class "small" and 125% of the baseline font size (i.e. 20 CSS pixels) in the CSS class "large":

body { font-size: 16px; } .small { font-size: 12px; /* 75% of the baseline */ } .large { font-size: 20px; /* 125% of the baseline */ }

?

對于適用于移動設備的其他字體建議,請參閱Android排版指南

Other information

Please read it carefullyCSS 2.1規(guī)范,以了解長度單位的定義方式。該規(guī)范包含此處未提到的其他單位:英寸、厘米、毫米和皮卡。另外,有一點很容易被人忽略,那就是CSS中1英寸并不一定等于1物理英寸。

所有絕對單位都是相對于其他單位而定義的。1像素等于0.75點,1點等于1/72英寸,而1英寸等于2.54厘米等。不過,這些單位的“定位”最終都取決于設備。例如,在紙張上打印時,1英寸就會錨定為1物理英寸,其他所有單位應相對于物理英寸而定。然而,在手機上顯示時,設備會根據(jù)著名的“參考像素”進行錨定。您可以根據(jù)此參考像素定義1 CSS像素,然后以CSS像素為參考來調整其他所有單位(例如,英寸、厘米等)。因此,1 CSS英寸通常會以小于現(xiàn)實中1物理英寸的大小顯示在手機上。

For this reason, we recommend that you use pixels to define the font size. Otherwise, some designers and developers may be misled to see that the units used are inches or dots, because although these units are also physical dimensions, they are not necessarily equivalent to real-world dimensions. Think of pixels as units that change the display size according to the size of your device.

Finally, each font has its own characteristics: size, spacing and so on. By default, the browser will display each font in 16 pixels (CSS pixels). This default setting works for most situations, but some specific fonts may need to be adjusted additionally, that is, you can set a lower or higher default font size to suit different font properties. Then, after the default size is set, define larger and smaller fonts based on the default pixel size to adjust the text size of major, minor, and other types of content on the Web page.

某些移動瀏覽器可能會在沒有恰當配置視口的情況下嘗試縮放網(wǎng)頁字體。由于這種縮放行為因瀏覽器而異,因此您最好不要依賴這種方式來為移動設備顯示清晰可辨的字體。PageSpeed Insights會照原樣顯示您網(wǎ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.


Articles
PageSpeed ??Insights
Back to List
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