Bootstrap中的文本区域自动高度

时间:2016-02-23 06:13:21

标签: html twitter-bootstrap cordova textarea

我正在使用Cordova开发混合应用程序。我面临的问题是将文本区域的高度设置为50%,这将使我的应用程序在平板电脑,手机等所有设备上均匀外观。我试图谷歌它并尝试所有的东西,但没有找到一个合适的解决方案。有人可以帮助我吗?

<textarea cols="50%">
At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.
</textarea>

我试过这样的事情

1 个答案:

答案 0 :(得分:-1)

你需要设置高度,而不是宽度。 cols设置宽度,属性rows设置高度。

使用此代码将视口的height设置为50%

<textarea rows="50%">
At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.
</textarea>

&#13;
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<textarea rows="50%">
    At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.
    </textarea>
&#13;
&#13;
&#13;