gpt4 book ai didi

html - 空白/有文本时插入符号在文本区域中的不同位置

转载 作者:行者123 更新时间:2023-11-28 12:41:16 29 4
gpt4 key购买 nike

我对 <textarea> 有疑问.其中的插入符根据是否为空具有不同的垂直位置:

enter image description here

我的代码:

textarea {
padding: 0 5px;
border: none;
outline: none;
overflow: hidden;
height: 30px;
vertical-align: middle;
line-height: 26px;
white-space: pre-wrap;
outline: 1px solid red;
}

演示: http://jsfiddle.net/oapbghfs/

最佳答案

这使您的文本对齐:

textarea {
padding: 5px;
border: none;
overflow: hidden;
vertical-align: middle;
white-space: pre-wrap;
outline: 1px solid red;
}

这是一个文本区域,默认有两行。

15px 的高度会使其看起来像一条线,然后您可以使用 JS 删除并调整该区域的大小。

关于html - 空白/有文本时插入符号在文本区域中的不同位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26407140/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com