由于某种原因,HTML textarea curson缩进

时间:2011-07-28 18:53:00

标签: html jsp

我需要将光标向左对齐。出于某种原因,它在页面上呈现时缩进:

             <td>
         You have <strong><span id="commentsCounter">${const['COMMENT_MAX_LENGTH'] - fn:length(commentForm.comment)}</span></strong> characters left.<br/>
            <textarea id="comment" name="comment" rows="2" cols="125" style="width:395px;"
                 onkeypress="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)"
                 onkeydown="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)"
                 onkeyup="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)">
              </textarea>

                    <a href="javascript:addComment();"><img src="../images/icon_add.gif" border="0" alt="Add"/></a>
        </td>
    </tr>

enter image description here

thanx的帮助

1 个答案:

答案 0 :(得分:11)

试试这个:

<textarea id="comment" name="comment" rows="2" cols="125" style="width:395px;" onkeypress="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)" onkeydown="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)" onkeyup="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)"></textarea>

您的结束</textarea>标记应始终位于同一行,以避免此类问题。