开发者

HTML Resizing Text

开发者 https://www.devze.com 2023-04-08 17:39 出处:网络
I want to have a div stay at 500 height.Text is dynamically inserted into this div.Different text lengths are 开发者_StackOverflowinserted.Right now, my div expands to accomodate the full text.How can

I want to have a div stay at 500 height. Text is dynamically inserted into this div. Different text lengths are 开发者_StackOverflowinserted. Right now, my div expands to accomodate the full text. How can I instead have text shrink so it always fits within the bounds?


You cannot use HTML and CSS to dynamically re-size text. You can set the div height to 500px, and either have scroll or hide any extra text.

You can use JavaScript to re-size the text dynamically, but the solution may not be practical if the text length varies widely. Your text will be unreadable if under 10px.

0

精彩评论

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