


The correct solution for Google's default minimum font of 12px (css, html)_html/css_WEB-ITnose
In today’s morning meeting, the product asked to change the font size from 12px to a smaller size. I thought to myself how difficult this was, so I casually agreed. Unexpectedly, when changing the CSS, when the font-size in Google Chrome is less than 12px, the font will no longer be reduced. My first reaction at that time was whether other css had covered the font. As a result, I couldn't find it after looking for a long time. So, only Baidu was involved, and the result was really surprising: It turns out that Google and Google-based browsers can only have a minimum font size of 12px in the Chinese language. I don’t know if this is a bug or Google’s humane design. No matter there are so many, we have to solve this problem anyway~ Since this is a classic compatibility problem, there must be many solutions. Surprisingly, on Baidu, all the solutions on the Internet are surprisingly similar:
html{
-webkit-text-size-adjust:none;
}
Then, after I used it happily, I found that it was useless. Later, I checked the information and learned that support for this attribute was removed after Chrome 27. Damn, isn't this a lie? Another solution was discovered:
.small-font{
font-size: 12px;
-webkit-transform-origin-x: 0;
-webkit-transform: scale(0.90);
}
Using the scaling of css3, the final size is: 12px * 0.9 (scaling ratio) = 10.8px;
It works Makes sense. But looking back, if I write it this way, will IE7 and IE8 be incompatible, or will it be 12px? As expected, it is not compatible. At this point, I looked back and thought, should I add a style font-size? I tried it, and it is indeed compatible with Google, IE7, and IE8. The code is as follows:
.small-font{ font-size:12px;
-webkit-transform-origin-x: 0; -webkit-transform: scale(0.90);
}
font-size:10.8px;
}
Warm reminder:
Um, after thinking about it, Others may also encounter this problem, and I can no longer waste time with online methods that cannot solve the problem, so I wrote this essay~
Haha~ I finally finished it. It’s my first time writing, so nervous~

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

How to distinguish between closing tabs and closing entire browser using JavaScript on your browser? During the daily use of the browser, users may...
