开发者

Making the font-size the max that can fit inside of its parent div

I want to have the text inside of a div to basically be the max height/size th开发者_开发技巧at could even fit inside of the div. Is this possible without JS?


When you say you want it to fill it's parent div, then you mean dynamic. When there is dynamism, either you should use relative CSS (elastic, or fluid CSS; em and en sizes or percentages), or you should use JavaScript.

So, the answer to your question is clear. You can do that, but you should use relative CSS measurement units. In other words, you should use %, em, and stuff like that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜