What should I do if Google Chrome does not support CSS settings for text smaller than 12px?

php中世界最好的语言
Release: 2018-05-28 16:38:20
Original
2966 people have browsed it

The tutorial I bring to you today is a solution to the problem that Google Chrome does not support setting CSS smaller fonts.

Web pages often use large or small text for beautiful layout. Usually ##font-size text is 12px (pixel) text. Set the text font to be larger than 12px, and each browser can display the text size effect set by CSS. However, when the CSS setting is smaller than 12px text, Google Chrome cannot display the text font effect set by CSS smaller than 12px.

Google Chrome support settings

font-sizeSolution for pixels smaller than 12px

The default minimum font of Google Chrome is 12px, and fonts smaller than 12px will be displayed as 12px. Sometimes we need to make the font smaller, especially when making English websites, we often use CSS styles to display text smaller than 12px, so that Google Chrome cannot display the smaller text. There are solutions though.

Solve the required CSS code

Add a Google Chrome-specific kernel

attribute style in the html or body (or if you need to set the small text font object CSS SelectorYou can also add) the following CSS code:

html,body{-webkit-text-size-adjust:none;}或.pcss5{-webkit-text-size-adjust:none;}
Copy after login

Note: If this attribute is used, the browser's font will not be able to use the zoom function! (It is the function of holding down the CTRL key and scrolling the middle mouse button up and down)

Try changing the unit - useless:

Some friends also said that using em (characters) as the unit to define the font size is useful. I have personally tested that the smallest font size in Google Chrome will not be smaller than 12px. So it's useless. For now I only know the above method.

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

Answers to questions about camel case naming and JS

Boolean values, relational operators in JS, Detailed explanation and examples of logical operators

## Summary of the front-end js framework and explanation of its uses

The above is the detailed content of What should I do if Google Chrome does not support CSS settings for text smaller than 12px?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template