【发布时间】:2018-08-27 11:58:39
【问题描述】:
我一直在为学校做一个编码项目,在其中一个页面上,我的 textarea 框给我带来了一些麻烦。它们需要有 5% 的左右边距,但我可以看出左右边距略有不同,所以我只是想弄清楚这是怎么回事。此外,我需要能够将 textarea 框的高度设置为一个百分比,以便它与屏幕尺寸相关,但我能够改变它们高度的唯一方法是将其设置为像素测量值。
两个 textarea 框的 css 如下所示:
#input {
width: 90%;
margin-top: 5%;
margin-bottom: 3%;
margin-left: 5%;
margin-right: 5%;
border-radius: 12px;
outline: none;
border: none;
}
#output {
width: 90%;
margin-top: 3%;
margin-bottom: 5%;
margin-left: 5%;
margin-right: 5%;
border-radius: 12px;
outline: none;
border: none;
}
...您可以访问该页面的最终结果here。
谢谢!
【问题讨论】:
标签: html css height textarea margin