Font size auto adjust to fit

后端 未结 7 1787
夕颜
夕颜 2020-12-09 09:06

I\'m trying to do what the title says. I\'ve seen that font-size can be a percentage. So my guess was that font-size: 100%; would do it, but no.

7条回答
  •  囚心锁ツ
    2020-12-09 10:08

    Can't be done with CSS.

    100% is in relation to the computed font-size of the parent element.

    reference: http://www.w3.org/TR/CSS2/fonts.html#font-size-props

    For a jQuery solution look at Auto-size dynamic text to fill fixed size container

提交回复
热议问题