为什么不建议将 font-size 设置为 12px 以下?

问题:为什么不建议将 font-size 设置为 12px 以下?如果一定要设置为 12px 以下要怎么做?

先看看把 font-size 设置为 12px 以下时的效果:(浏览器为 Chrome 52)

在其他浏览器上效果却不一样:

因为 Chrome 这款任性的浏览器做了如下限制:

  1. font-size 有一个最小值 12px(不同操作系统、不同语言可能限制不一样),低于 12px 的,一律按 12px 显示。理由是 Chrome 认为低于 12px 的中文对人类是不友好的。

  2. 但是允许你把 font-size 设置为 0.

  3. 这个 12px 的限制用户是可以自行调整的,进入 chrome://settings/fonts 设置,滚动到最下方你就可以调整 12px 为其他值。

如果我一定要设置小于 12px 的字体怎么办?

  1. Chrome 29 版本之前,你可以使用 -webkit-text-size-adjust: none; 来解除这个限制。29 版本后,就不能这样做了。

  2. 你可以先设置 12px,然后使用 transform: scale(0.833333) 将元素缩小,效果跟 10px 很接近。不过要注意的是,transform: scale 出了缩小 font-size,也会缩小其他一些属性,需要多测试。

作者:方应杭

28 thoughts on “为什么不建议将 font-size 设置为 12px 以下?”

  1. Thanks for one’s marvelous posting! I truly enjoyed reading it, you will be a great author. I will make certain to bookmark your blog and will eventually come back in the future. I want to encourage you continue your great writing, have a nice afternoon!|

  2. I used to be very pleased to seek out this web-site.I wished to thanks in your time for this excellent read!! I undoubtedly having fun with each little bit of it and I’ve you bookmarked to check out new stuff you weblog post.

  3. You can definitely see your enthusiasm within the article you write.
    The arena hopes for even more passionate writers such as you
    who are not afraid to mention how they believe. Always go after
    your heart.

  4. Hi there I am so delighted I found your website, I really
    found you by accident, while I was looking on Google for something else, Regardless I
    am here now and would just like to say thank you for a tremendous post and a all round thrilling
    blog (I also love the theme/design), I don’t have time to go through
    it all at the minute but I have bookmarked it and also added your RSS
    feeds, so when I have time I will be back to read a great deal more, Please do keep up the fantastic b.

  5. I together with my buddies came checking out the great guides located on your web page then then I got a terrible suspicion I had not expressed respect to you for those techniques. Those people happened to be so stimulated to read them and now have definitely been taking advantage of them. Thank you for genuinely really accommodating as well as for pick out these kinds of useful topics millions of individuals are really needing to learn about. Our honest regret for not saying thanks to sooner.

  6. I am also commenting to make you know of the outstanding discovery our girl gained going through yuor web blog. She even learned several pieces, with the inclusion of how it is like to have a very effective coaching character to have certain people without difficulty learn about a variety of multifaceted things. You truly surpassed my desires. I appreciate you for presenting the helpful, safe, educational as well as unique tips on the topic to Mary.

  7. My wife and i were now relieved Michael could complete his investigation through the entire ideas he obtained in your blog. It’s not at all simplistic to simply be giving for free key points that a number of people may have been trying to sell. Therefore we figure out we need the website owner to appreciate because of that. All the explanations you made, the easy blog navigation, the friendships you make it easier to promote – it’s got all excellent, and it is letting our son and us know that that theme is thrilling, which is certainly especially mandatory. Thank you for all the pieces!

  8. I have to express my appreciation to this writer just for rescuing me from this particular problem. Just after looking throughout the world-wide-web and finding notions that were not pleasant, I thought my entire life was over. Living without the presence of answers to the problems you have resolved by way of your good write-up is a critical case, as well as those which could have in a wrong way damaged my career if I hadn’t encountered your website. Your good talents and kindness in controlling all the details was crucial. I don’t know what I would’ve done if I had not come upon such a thing like this. I am able to at this time relish my future. Thank you so much for this impressive and amazing guide. I won’t think twice to refer your web page to any individual who should receive direction about this subject matter.

  9. Thank you so much for giving everyone an extraordinarily remarkable opportunity to read in detail from this blog. It’s usually so useful and as well , packed with amusement for me and my office acquaintances to search your website at the least 3 times in 7 days to study the latest guidance you will have. And indeed, we are at all times happy with all the cool guidelines you serve. Some two facts on this page are absolutely the finest we have all had.

  10. My wife and i were absolutely more than happy when Louis could do his homework out of the ideas he gained from your web pages. It’s not at all simplistic just to continually be giving freely secrets a number of people could have been making money from. We really acknowledge we have got the website owner to be grateful to because of that. The most important explanations you made, the easy website navigation, the friendships you can make it easier to instill – it is mostly unbelievable, and it is helping our son in addition to us feel that this topic is thrilling, which is incredibly pressing. Thanks for the whole lot!

  11. I visited various web sites but the audio feature for audio songs current at this web page is genuinely excellent.

    y2yxvvfw cheap flights

  12. I just like the valuable info you provide in your articles.

    I will bookmark your weblog and test again right here
    frequently. I am relatively sure I’ll be informed many new stuff
    proper right here! Best of luck for the next! 32hvAj4
    cheap flights

  13. I and my pals were going through the good things located on your website and so all of the sudden got a terrible feeling I had not expressed respect to the blog owner for those techniques. Those men ended up for that reason very interested to read through all of them and already have undoubtedly been making the most of these things. Thanks for being so accommodating and for picking out this form of perfect resources millions of individuals are really eager to learn about. My personal honest apologies for not expressing gratitude to sooner.

  14. We are a group of volunteers and opening a new scheme in our community.
    Your web site provided us with valuable info to work on. You
    have done an impressive job and our whole community will be thankful to you.

  15. Write more, thats all I have to say. Literally, it seems
    as though you relied on the video to make your point. You obviously know what youre talking about,
    why throw away your intelligence on just posting videos to your weblog when you could be
    giving us something enlightening to read?

  16. Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance”
    between user friendliness and visual appeal. I must say you have done a superb job with this.
    Additionally, the blog loads extremely quick for me on Safari.
    Excellent Blog!

  17. I have read so many posts on the topic of the blogger lovers except this piece
    of writing is genuinely a nice article, keep it up.

  18. I enjoy you because of each of your effort on this site. Debby loves engaging in research and it’s really simple to grasp why. My partner and i know all of the lively form you create both interesting and useful things by means of your blog and strongly encourage contribution from people on this article while our favorite princess has been discovering a whole lot. Take pleasure in the remaining portion of the year. You are always conducting a really good job.

  19. I want to show appreciation to you just for rescuing me from this problem. Because of scouting through the internet and getting proposals that were not helpful, I believed my life was gone. Existing without the solutions to the problems you’ve fixed by way of your guideline is a critical case, as well as the ones that might have negatively damaged my career if I hadn’t come across your blog post. That knowledge and kindness in maneuvering all the details was very useful. I don’t know what I would have done if I had not come upon such a stuff like this. It’s possible to at this moment relish my future. Thanks a lot so much for your expert and sensible guide. I will not hesitate to propose your site to any person who will need guidance about this problem.

  20. I loved as much as you’ll receive carried out right here.
    The sketch is attractive, your authored subject matter stylish.
    nonetheless, you command get bought an nervousness over that you wish be delivering the following.
    unwell unquestionably come more formerly again since
    exactly the same nearly a lot often inside case you shield
    this hike.

  21. My wife and i have been absolutely excited that Raymond managed to round up his inquiry with the precious recommendations he made when using the blog. It is now and again perplexing to simply happen to be giving for free secrets and techniques that people today could have been making money from. We really consider we now have the writer to thank for that. The specific explanations you’ve made, the straightforward blog navigation, the friendships you will make it easier to engender – it is mostly sensational, and it’s letting our son in addition to us consider that the theme is excellent, and that is tremendously pressing. Thank you for all!

  22. Hi there! I just would like to give a huge thumbs up for the good information you’ve here on this post. I will likely be coming again to your blog for extra soon.

  23. Incredible! This blog looks just like my old
    one! It’s on a completely different topic but it has pretty much the
    same page layout and design. Excellent choice
    of colors!

  24. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment
    is added I get four emails with the same comment. Is there
    any way you can remove people from that service? Appreciate it!

  25. Oh my goodness! a tremendous article dude. Thanks Nevertheless I’m experiencing concern with ur rss . Don抰 know why Unable to subscribe to it. Is there anybody getting equivalent rss problem? Anyone who is aware of kindly respond. Thnkx

发表评论

电子邮件地址不会被公开。