开发者

How to make the text content auto fill all the space of its parent element

开发者 https://www.devze.com 2023-04-01 00:45 出处:网络
I have a div,which content some text content. <div id=\"con\" style=\"position:absolute;left:50px;top:50px;border:1px solid red;font-size:12px;\">

I have a div,which content some text content.

<div id="con" style="position:absolute;left:50px;top:50px;border:1px solid red;font-size:12px;">
    Text Here!
</div>
开发者_运维知识库

Note,that I do not set the "width" and "height" of the "div#con",since I do not want to see any blank space.

Now,I want to make the "div#con" resizeable,when the "div#con" resize,I want the text's fontsize inside it changed accordingly.

Any idea?


Have a look at the jQuery TextFill plugin and also to this topic with severals solutions.

I think you should find the answer.

0

精彩评论

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

关注公众号