Every browser manufacturer has its own design subjectivity, and these starting points seem good but often hurt programmers deeply.
1. Requirements
The rendering is specified as a Google browser and the font size is 6-8 PX (to print small sizes ).
2. Explore 2.1 CSS hack
Multiple web pages searched for N point to one result:
Html
{ -webkit-text-size-adjust:none;}
Put the above Code at the beginning of the document...
Yes, that is, it does not take effect... The result is a series of reactions, such as rough tone, blushing, and wide-eyed.
2.2 spring of CSS 3
I just brought a book about the characteristics of css3. I quickly browsed the entire book and found a feature:
div { transform:scaleY(0.8);}
--Scale the specified tag. For example, the code above means that the height (y) of the DIV and its child elements (including text and font size) is reduced to 80%.
Similarly, scale down the width: scalex (Pre), Overall scale-down (Pre).
Try to scale down.
However, if HTML is like this:
<div id="d1">your text</div><div id="d2">your text2</div>
So there will be a lot of white space between D1 and D2. How can I leave this white space?
Two rules:
{ margin-top:-12px; padding-bottom:-12px;}
Using the negative value of Marin, you can move the margin to the specified direction, that is, the entire element;
Using the negative value of padding, you can move the padding to the specified direction, that is, supporting the big dollar margin;
After that, the reduced text does not change, so it achieves the effect-scale down the font in the Google browser and perform the same operations as normal.
3. Summary
Transform is actually an implementation of computer graphics, such as 2D transformation and 3D transformation.
The Foundation is very important, and every effort will not be wasted ~.
Google does not support the ultimate solution for fonts smaller than 12px