input高度自适应
时间: 2023-11-07 10:53:10 浏览: 92
高度自适应的方法有三种。其中一种方法是使用div标签,并将contenteditable属性设置为true,如下所示:
<div contenteditable=true></div>
这样,div标签就可以像textarea或input一样根据输入内容的高度进行自适应。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* *3* [模拟input输入框高度自适应](https://blog.csdn.net/weixin_39868663/article/details/118394460)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *2* [textarea Input输入框高度自适应方法](https://blog.csdn.net/zyxinside/article/details/127387824)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文