Chrome does not support a workaround for CSS fonts less than 12px

Source: Internet
Author: User

Let's take a look (under Chrome):



From the above figure can be clearly seen in Chrome under the CSS settings font size 12px and below, the display is the same size, are the default 12px;

Then there is a way to add chrome private properties to the current style:-webkit-text-size-adjust:none;
But I found out after verification that there was no effect. Later the data learned that after Chrome 27 to cancel the support of this property, then how should we set the font under Chrome?

You can take advantage of CSS3 's scaling properties: Transform:scale ()

.small-font{  font-size: 12px;  -webkit-transform: scale(0.5);}

This is OK to add this attribute on the element, but it is not compatible with IE, FF, so a compatibility is written:

.small-font{  font-size: 12px;  -webkit-transform: scale(0.5);}.smallsize-font{  Font-size: 6px;}<p class=“small-font samllsize-font”>温馨提示</p>

At this time a classmate said you this is not right ah, I added such a formula has no effect, don't hurry ha, carefully look at your element is not the element ah?
Note: transform:scale() This property can only be scaled to define the width of the element, and the inline element is not wide, we can add a display:inline-block; property just fine.

PS: There are small partners let REM solve, I explain here ah, EM, REM is a relative unit, based on the size of the root element is calculated, the purpose is the browser font size changes, the page layout and font size can be adaptive. That is to say that the browser to render is or XX px, the Chrome browser itself is not rendering 12px below the font, so this method is not feasible, rem although good, but not the disease.

Chrome does not support a workaround for CSS fonts less than 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.