我有一个简单的文本区域,像这样的形式:

<textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink">
    <?php if($siteLink_val) echo $siteLink_val; ?> 
</textarea>

我一直在这个文本区域得到额外的空白。当我tab到它,我的光标就像在文本区域的中间,而不是在开始?怎么解释呢?


当前回答

只需要在同一行中定义你的和你的close标记。

<textarea class="form-control"
          id="newText"
          rows="6"
          placeholder="Your placeholder here..."
          required
          name="newText"></textarea>

其他回答

此外,当你说光标是在“中间”的文本区域,这让我认为你也可以有额外的填充或文本对齐:中心定义在你的CSS某处。

我知道已经很晚了,但是我可以帮助别人。

在需要文档缩进时使用此选项。

$(document).ready(function()
{
    $('textarea').each(function(){
            $(this).val($(this).val().trim());
        }
    );
});

同样的问题

基本上应该是这样

<textarea>something here with no spaces in the begining</textarea>

如果有一些预定义的空间,让我们说由于代码格式如下

<textarea>.......
....some_variable
</textarea>

点所示的空格在每次提交时不断增加。

<textarea style="width:350px; 
 height:80px;" cols="42" rows="5" name="sitelink"
 ><?php if($siteLink_val) echo $siteLink_val; ?></textarea> 

移动……>向下对我来说很合适。

只需要在同一行中定义你的和你的close标记。

<textarea class="form-control"
          id="newText"
          rows="6"
          placeholder="Your placeholder here..."
          required
          name="newText"></textarea>