Today morning meeting, product requirements to the previous 12px font to a smaller, I thought it was difficult, just casually agreed. Do not know, when changing the CSS, Google browser font-size less than 12px, the font will not be reduced. My first reaction was whether the other CSS would overwrite the font. The results have not been found for a long day. So, only a group of Baidu, the result is really surprising: the original Google and Google kernel browser in Chinese language, the smallest font can only be 12px. Do not know if this is a bug or Google humanized design. Regardless of that many, anyway to solve this problem ~ Since this is a classic compatibility problem, there must be a lot of solutions. Surprisingly, the Baidu gang, all the solutions on the Internet are surprisingly similar:
html{
-webkit-text-size-adjust:none;
}
Then I used it with gladness, and found that there was no bird to use. Later, we looked at the information and learned that after Chrome 27, the support for this attribute was canceled. This isn't a pit-daddy, is it? Vista, and then found another workaround:
. small-font{
font-size:12px;
-webkit-transform-origin-x: 0;
-webkit-transform:scale (0.90);
}
With CSS3 scaling, the final size is: 12px * 0.9 (scale) = 10.8px;
It can be done. But back to think, so write, IE7 IE8 will not be incompatible, or 12px? As expected, it is not compatible. At this time, and then back to think, or add a style font-size? Tried, sure enough compatible with Google, IE7,IE8, the code is as follows:
. small-font{
font-size:12px;
-webkit-transform-origin-x: 0;
-webkit-transform:scale (0.90);
}
. smallsize-font {
font-size:10.8px;
}
<p style= "color: #FF0000;" class= "Small-font Smallsize-font" > Warm tips:</p>
The right solution for Google's default minimum font 12px (CSS, HTML)