About the correct solution for Google Chrome's minimum font 12px

Source: Internet
Author: User

  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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.