Chrome Google Browser does not support the CSS font less than 12px solution

Source: Internet
Author: User

First look at the IE, Firefox, Google Browser under the various font display situation

IE under:

Under Firefox:

Google under:

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

Then there is always a way to add Google private properties to the current style:-webkit-text-size-adjust:none;

However, I verified that the new version of Google is now invalid. So how do we set the font under Google?

We can use a property in the CSS3:transform:scale ()

Property description can be stamped here: http://www.w3chtml.com/css3/properties/2d-transform/transform.html

This property before the-webkit-Google prefix, then you can control the size of the font, the code is as follows:

1

2

3

4

5

6

7

<style>

p{font-size:10px;-webkit-transform:scale(0.8);}

/*这里的数字0.8,是缩放比例,可以根据情况变化。*/

</style>

<p>中梦测试10px</p>

Such as:

But note that if the <p> element has a background, giving this attribute will change the background as well, so we can set a <span> in the <p> tag.

1 <style>2 P span{font-size:10px;-webkit-transform:Scale (0.8);}3 </style>4 5 <P><span>Middle Dream Test 10px</span></P>

You will find no effect,

This is because Transform:scale () is a property that can be scaled to define a wide-height element, while span is an inline element;

We can define a display:block for the span element, so we can do it.

1 <style>2 P span{font-size:10px;-webkit-transform:Scale (0.8);Display:Block;}3 </style>4 5 <P><span>Middle Dream Test 10px</span></P>

The font can be changed by walking through Google Chrome.

Chrome Google Browser does not support the CSS font less than 12px solution

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.