【问题标题】:React input textfield should not vertically align and not wrapReact 输入文本字段不应垂直对齐且不换行
【发布时间】:2017-04-28 13:42:53
【问题描述】:

我有一个带有输入文本字段的反应前端。这些输入中的文本不会从输入字段的顶部开始并适当地换行。

这是 CSS:

input {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  color: #2F363A;
  font-size: 16px;
  height: 140px;
  line-height: 19px;
  padding-left: 10px;
  width: 100%;
  -webkit-appearance: none;
}

input {
  background-color: white;
  -webkit-rtl-ordering: logical;
  user-select: text;
  cursor: auto;
  text-rendering: auto;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  text-indent: 0px;
  text-shadow: none;
  display: inline-block;
  text-align: start;
  margin: 0em 0em 0em 0em;
  -webkit-writing-mode: horizontal-tb;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>

<input
  placeholder="Enter key results..."
  className="medium"
  id="last"
/>

【问题讨论】:

  • 为什么不试试 textarea 而不是输入?

标签: css reactjs textfield


【解决方案1】:

试试这个:

<textarea cols="30" rows="10"></textarea>

【讨论】:

    猜你喜欢
    • 2012-04-23
    • 1970-01-01
    • 2022-12-16
    • 2013-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-17
    • 2022-01-04
    相关资源
    最近更新 更多