【问题标题】:How I can set the cursor of writing in the left-top of Input in html如何在 html 中输入的左上角设置书写光标
【发布时间】:2018-05-10 23:53:05
【问题描述】:

我在 html 中使用 Input 标签,我希望输入框的高度更大。我将其设置为 200 像素。 我的代码是:

<input type="text" class="form-control" name="description" placeholder="Enter description" 
[(ngModel)]="description" style="height:200px" >

它起作用了,但是占位符句子和书写光标从中间开始,如上图所示。 如何在 html 中输入的左上角设置书写光标 我试过这个“vertical-align:text-top,但没用!

【问题讨论】:

  • 输入是单行的。如果您想要多行文本,请使用 textarea 元素。
  • 或contentEditable div

标签: html typescript input alignment


【解决方案1】:

您刚刚使输入框“更大”(实际上给了它更高的高度),但它仍然只有一个文本行!如果你想拥有更大的文本区域,你应该使用...textarea,然后你可以使用rows属性来决定你想要多大。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多