Is there really any point to using relative font sizing in CSS?

前端 未结 7 523
孤城傲影
孤城傲影 2020-12-31 16:01

I\'ve read a lot about the pros and cons of sizing with either relative or absolute font sizes. Fixed sizes don\'t zoom in IE6 but that\'s not much of an issue these days. A

7条回答
  •  攒了一身酷
    2020-12-31 16:45

    According to YUI Font CSS,

    Always use percentages as the units because they render more consistently than ems, and because they allow user-initiated resizing (unlike pixels).

    Relative font sizes work pretty well when they are part of a framework like YUI. Especially because they normalize how fonts work across browsers.

    Personally, I do throw in absolute px every once in a while, but typically only for text that must somehow match up size-wise with some other design elements (like a menu).

    The % stuff does break down when you assign % to a certain element and then a different % to a contained element. But that's the only real gotcha I've found.

提交回复
热议问题