【发布时间】:2016-11-24 10:47:25
【问题描述】:
我在此表单中的文本区域遇到以下问题。第一张图片在我的电脑里,表格看起来还不错,但是在第二张图片中,文本区域看起来很奇怪。我想知道造成这种行为的原因是什么,以及如何改进。
html
<div className="information-wrapper col-md-12 col-sm-12 col-xs-12">
<div className="icon-container col-md-3 col-sm-3 col-xs-3">
<img src="/name-image.png"/>
</div>
<div className="text-container col-md-9 col-sm-9 col-xs-9">
<textarea className="information-textarea" placeholder={I18n.t('name')} />
</div>
</div>
css
.information-wrapper{
padding-right: 0;
padding-left: 0;
width: 100%;
height: 51px;
border-radius: 4px;
background-color: #ffffff;
margin-bottom: 10px;
.icon-container{
max-width: 53.65px;
padding-right: 0;
padding-left: 0;
height: 51px;
border-right: 0.5px solid #e7e5e8;
text-align: center;
img{
margin-top: 15px;
width: 22px;
height: auto;
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
}
.text-container{
padding-right: 0;
padding-left: 0;
height: 51px;
.information-textarea{
height: 95%;
width: 100%;
font-size: 17px;
font-weight: bold;
padding-left: 5.5px;
padding-top: 15px;
border: 0;
border-radius: 4px;
resize: none;
white-space: nowrap;
overflow-x: scroll;
}
}
}
【问题讨论】:
-
分享两个内容的代码,否则小提琴会有所帮助
-
为什么你使用
textarea来做这些输入?其中大多数是简短的单行输入,您应该使用<input type="text">。 -
我猜我的错,没想太多。
-
为什么不直接隐藏溢出
标签: javascript html user-interface reactjs frontend