开发者

decreasing font size in a text box dynamically

开发者 https://www.devze.com 2022-12-09 07:24 出处:网络
Is it possible to dynamically control the font size in a text area / text box开发者_开发百科 so it decreases while the user types? (ie the character i+1 is smaller than character i)

Is it possible to dynamically control the font size in a text area / text box开发者_开发百科 so it decreases while the user types? (ie the character i+1 is smaller than character i)

Thanks


No, it's not possible in a text area or a text box. The font-size specified for those controls will affect all text in them. You could, however, achieve the effect by using a regular <div> and making its content editable, as is done in WYSIWYG editors.

Here's a simple example.

0

精彩评论

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