HTML Textarea - 光标从textarea的中心开始,而不是从顶部开始 [英] HTML Textarea - cursor starting in center of textarea rather than top

查看:1504
本文介绍了HTML Textarea - 光标从textarea的中心开始,而不是从顶部开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML模板和CSS渲染一个textarea字段,但是当点击字段时,光标从文本区域的一半开始,而不是从我想象的左上角开始。

I have an HTML template and CSS that renders a textarea field, however when clicking in the field, the cursor starts from half way down the text area, not from the top left as I would expect.

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

This does not occur in IE, but does in Chrome and FF. I also get a list of previous values entered listed below, suggesting that the textbox styles are being applied.

任何人都可以建议我应该修改哪些CSS属性?

Can anyone advise on which CSS proprties I should be looking to modify?

以下是HTML:

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

这里是分配给文本区域的属性:

Here are the properties being assigned to the text area:

.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;
}


推荐答案

>

I think using

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

应该可以解决您的问题。

should solve your problem.

这篇关于HTML Textarea - 光标从textarea的中心开始,而不是从顶部开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆