分类:Web UI & Ajax, 网页&平面设计 作者: 秋天 on 08-04-2009
通过JS来控制网页字体,全局用em定制。就能在网页需要的地方,明显位置放置一个字体大小控制按钮。能增长的地方用em控制,定大的地方用pt or px。
据说现在主流浏览器都已经支持全局缩放 (具体看这里),就是放大整个screen而不仅仅是字体,但是由于还是需要照顾那30%的IE6 或者低版本Safari Opera用户,所以仍然需要用到。并且,具体用JS如何实现全屏缩放,暂时没找到实现方案。
在em设计的具体运用中,IE7 和 FF在自身缩放上又会有一些个bug,后文有引用别人的描述和解决方案。
Text for the screen is sized with CSS in terms of pixels, ems or keywords. As most of us know, sizing with pixels is easy: get your selector and give it a
font-size– no more thought required. Sizing with keywords is more complicated and requires a few workarounds, but you’re in luck as the techniques are well documented. That leaves ems. At this point people often leg it. ‘Ems are too inconsistent,’ they say, ‘they’re too hard; they never work.’ Well that may be the received wisdom, but if ever the was a case of FUD then this is it. I will now attempt to show you how ems can be as quick and easy to use as pixels. 点击浏览文章的全部内容 »