gpt4 book ai didi

HTML Textarea - 光标从 textarea 的中心而不是顶部开始

转载 作者:太空狗 更新时间:2023-10-29 15:20:55 26 4
gpt4 key购买 nike

我有一个呈现文本区域字段的 HTML 模板和 CSS,但是当单击该字段时,光标从文本区域的中间开始,而不是我期望的从左上角开始。

这不会出现在 IE 中,但会出现在 Chrome 和 FF 中。我还得到了下面列出的以前输入的值的列表,表明正在应用文本框样式。

谁能建议我应该修改哪些 CSS 属性?

这是 HTML:

<input id="description" class="textarea" type="textarea" name="description" cols="70" rows="50">

以下是分配给文本区域的属性:

.standardForm .textarea {
bottom: 0;
height: 90px;
left: 0;
margin-bottom: 0.5em;
right: 0;
}
custom.css (line 255)
.standardForm .textbox, .standardForm .textarea, .standardForm .submit, .standardForm .select {
background: none repeat scroll 0 0 White;
border: 1px dotted #AAAAAA;
}
custom.css (line 251)
.standardForm .textbox, .standardForm .textarea, .standardForm .select {
font-size: 12px;
overflow: hidden;
padding: 7px;
resize: none;
width: 90%;
}
custom.css (line 250)
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, input, button, textarea {
background: none repeat scroll 0 0 transparent;
border: 0 none;
font-size: 100%;
font-weight: normal;
margin: 0;
outline: 0 none;
padding: 0;
text-decoration: none;
vertical-align: baseline;
}

最佳答案

在 textarea 标签之间提供空格通常会导致这种不需要的空白。尝试使用没有空格的代码来解决问题。 <textarea></textarea>

关于HTML Textarea - 光标从 textarea 的中心而不是顶部开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7050460/

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