HTML Resizing Text
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.
精彩评论