【问题标题】:Textarea doesnt start top left [duplicate]Textarea没有从左上角开始[重复]
【发布时间】:2021-02-02 07:26:13
【问题描述】:

我有两个问题正在发生,占位符不会出现,每当我点击我的文本区域时,它就会从我点击的位置而不是左上角开始输入?

textarea {
  outline: none;
  resize: none;
  text-align: start;
  border: 1px solid black;
  width: 100%;
  overflow: hidden;
}
<textarea cols="70" rows="4" placeholder="Adding a rich description will help with the search result">
                </textarea>

【问题讨论】:

  • 为什么占位符不能替代标签的完美示例:-D

标签: html


【解决方案1】:

仅当文本区域中没有内容时才会出现占位符。

您已经设置了“一堆空格和一个新行”的默认内容。

删除&gt;&lt;之间的内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-05
    • 1970-01-01
    • 2011-09-15
    • 2022-07-09
    • 2014-02-28
    • 2011-08-19
    • 1970-01-01
    • 2011-06-30
    相关资源
    最近更新 更多