-
Notifications
You must be signed in to change notification settings - Fork 4
字大小要小於12px做法
dreamline2 edited this page Jan 18, 2014
·
3 revisions
遇到要把字縮小到12px的需求
-webkit-transform : scale(0.75); // chrome safari
-o-transform : scale(1); // opera
transform : scale(0.75); //mozilla
display : inline-block; //看狀況有時 inline 會有問題
ie 不支援 transform , ie 可直接用 font-size 調整,
但其他瀏覽器使用 transform 可以,但是定位點是根據未縮小前的。
不會因為用了 transform ,定位點就會改變
所以如果要兼容 ie 字可以變小,可是由留原始大小空間的白色區域給其他瀏覽器
設定 right:0px 看ie會很靠近邊界
看chrome會還有一段距離,原因就是現代瀏覽器使用transform
#參考資料