-
Directory smaller than 12pxCSS is not supported
-
- Problem Analysis
- Google Chrome supports font-size small font
- Solve the required CSS code
- Before and after solution
- Unsolved HTML + CSS code
- HTML + CSS code after solution
- Understanding explanations
1. Google Chrome does not support setting small CSS fonts. Analysis of the Problem-TOP
Webpages often use large or small text to make the layout look beautiful. Generally, the font-size text is 12 PX (pixel) text. If the font size is greater than 12 PX, all browsers can display the effect of the text size set by CSS. However, when the CSS setting is smaller than 12px, google Chrome cannot display the text font with the CSS setting smaller than 12px.
2. Google Chrome supports font-size smaller than 12px. Solution:-TOP
Google Chrome's default minimum font is 12px, and smaller than 12px fonts are all displayed in 12px. Sometimes we need a small font, especially when creating an English website, CSS style is often used to display less than 12px text, in this way, Google cannot display small text. However, there are still solutions.
3. Solve the required CSS code-TOP
Add a Google browser-specific kernel attribute style in html or body (or add a CSS selector to the small text font object) as follows:
Html, body {-webkit-text-size-adjust: none ;}
Or
. Divcss5 {-webkit-text-size-adjust: none ;}
Note: If this attribute is used, the browser font cannot be scaled in or out! (That is, press CTRL to scroll up or down the middle mouse button)
Try to change the unit-useless:
Some friends say that it is useful to define the font size in units with em (characters. I personally tested that the font in em should be smaller than or smaller than 12px in Google browsers. So it is useless. For now, I only know the above method.
4. Compare the browser with the font-TOP
Comparison between font-size and 12-pixel font
Partial code before and after HTML + CSS code:
5. Set the front HTML + CSS code:-TOP
6. After setting the CSS style, DIV + CSS code:-TOP
7. Master and summary:-TOP
Google Chrome is the core of Webkit and has a private CSS Attribute-webkit-text-size-adjust. It enables the font size not to be affected by terminal devices or browsers.
The CSS style is defined as follows:
-Webkit-text-size-adjust: none;
The question about how to set the font size of CSS styles in Google's browser is finally settled, so that other browsers will not be affected by this CSS style attribute.