chrome字体最小值12px问题及解决方法
昨天我修改自己的WordPress天气插件的时候,发现一个比较有趣的问题:chrome竟然最小的字体是12px,而小于12px的数值,百分比之类的都不起左右,都是显示12px。
对于这个问题,我上google搜索了半天也没有结果,本来因为是css出现了问题,测试了好多次都不行,于是最后来了个style=”font-size:10px”都没有显示成功,之后我写了一段代码在本地测试,还是不行,问了同事,同事都是表示不知道。
后来是怀疑自己的html声明写错了,可是更换了标准声明还是不行,至今还是表示疑惑,找到了客户端设置chrome的方法,而没有css hack的方法没有找到,希望高手给个css hack解决的方法。
WordPress天气预报插件地址:http://js8.in/mywork/weather
demo地址:http://js8.in/mywork/weather/demo.php?city=0532

解决方法
2.
Basically, the Chrome browser is based on WebKit. There are some webkit internal font setting options for font family, font size, etc.
Using text editor to open “Documents and SettingsUser_NameLocal SettingsApplication DataGoogleChromeUser DataDefaultPreferences”
You will find the “webkit”: { “webprefs”: { in the file. Those settings are for WebKit.
In my setting example:
“webkit”: {
“webprefs”: {
“default_fixed_font_size”: 11,
“default_font_size”: 12,
“fixed_font_family”: “Bitstream Vera Sans Mono”,
“minimum_font_size”: 12,
“minimum_logical_font_siz”: 12,
“sansserif_font_family”: “Times New Roman”,
“serif_font_family”: “Arial”,
“standard_font_is_serif”: false,
“text_areas_are_resizable”: true
}
}
The minimum_font_size and minimum_logical_font_size prevent Chrome to use very small font size for display.
Remember to close Chrome first before you edit the file, or the file you saved will be overwritten by Chome after exiting.