Home > Web Front-end > H5 Tutorial > body text

Google Chrome small font processing solution, that is, fonts below 12px_html5 tutorial skills

WBOY
Release: 2016-05-16 15:48:32
Original
1656 people have browsed it

Google Chrome does not support small fonts below 12px, maybe because of user experience.
There are also some articles on the Internet saying that it can be used:

Copy the code
The code is as follows:

-webkit-text-size-adjust:none;

However, since chrome 27, support for this attribute has been removed.

Do we have any other ways to solve this problem?

Google Chrome supports CSS scaling, so we can make a fuss about this:

Copy code
The code is as follows:

-webkit-transform: scale(0.5);

Since the minimum support is 12px, then scale based on 12px,

At the same time, you can use -webkit-transform-origin-x: 0; to solve the displacement problem of margin-left after scaling:

Copy code
The code is as follows:

.test_tag{
font-size:12px;
-webkit-transform-origin-x: 0;
- webkit-transform: scale(0.5833333333333334);
}

The scale value is calculated as: 7 / 12 = 0.5833333333333334
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!