简体   繁体   English

Bootstrap中的文本区域自动高度

[英]Text Area Auto Height in Bootstrap

I am Developing an Hybrid app using Cordova. 我正在使用Cordova开发混合应用程序。 I am facing the problem to make Height of Text Area as 50% which will give my app a uniform look on all devices like Tablet,cell phones etc. I tried to google it and try all stuff but did not find a proper solution. 我面临的问题是将文本区域的高度设置为50%,这会使我的应用在平板电脑,手机等所有设备上具有统一的外观。我尝试通过Google搜索并尝试所有方法,但没有找到合适的解决方案。 Can some one please help me ? 有人可以帮帮我吗 ?

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

I tried some thing like this 我尝试过这样的事情

well you need to set the height, not the width. 那么您需要设置高度,而不是宽度。 the cols sets the width and the attribute rows set the height. cols设置宽度,属性rows设置高度。

use this code to set the height to 50% of the viewport. 使用此代码将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>

 <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> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM