文本太长时HTML / javascript会垂直展开文本框 [英] HTML/javascript vertically expand textbox when text is too long
本文介绍了文本太长时HTML / javascript会垂直展开文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望包含元素(a或元素)自动垂直扩展以容纳已达到行尾的文本。有没有办法用纯HTML元素做到这一点?如果没有,我可以使用JavaScript做到这一点吗?
谢谢。对不起,但在纯HTML中没有办法。有了Javascript,它是可能的。
看看 jQuery插件:autoResize 。 注意:这是一个jQuery插件。
另请参阅此线程以获取更多jQuery替代品。
I wish the containing element (either a or element) to automatically expand vertically to accommodate text that has reach the end of line. Is there a way to do this with plain HTML elements? If not, can I do this using javascript?
Thanks.
解决方案
Sorry, but there is no way to this in plain HTML. With Javascript it's possible though.
Take a look at jQuery plugin: autoResize. Note: this is a plugin for jQuery.
Also, see this thread for more jQuery alternatives.
这篇关于文本太长时HTML / javascript会垂直展开文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文