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;
}
chrome 27, support for this attribute was canceled. It's not a pit dad, 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{
-webkit-transform-origin-x: 0;
-webkit-transform:scale (0.90);
}
. smallsize-font {
font-size:12px;
}
<p style= "color: #FF0000;" class= "Small-font Smallsize-font" > Warm tips:</p>
Well, think of the next, others should also encounter this problem, can no longer be online and can not solve the problem of the method of wasting time, so wrote this essay ~
haha ~ finally finished, first write, good nervous ~
About the correct solution for Google Chrome's minimum font 12px