jQuery Mobile and textarea rows

家住魔仙堡 提交于 2019-12-03 15:33:31

The jQuery Mobile CSS sets a specific height for textarea elements:

textarea.ui-input-text {
    height : 50px;

    -webkit-transition : height 200ms linear;
       -moz-transition : height 200ms linear;
         -o-transition : height 200ms linear;
            transition : height 200ms linear;
}

You can create your own rule to override this height to something more single-line:

.ui-page .ui-content .ui-input-text {
    height : 25px;
}​

Demo: http://jsfiddle.net/mEs8U/

You can also use max-height to set the autogrowing limits to textarea.

textarea.ui-input-text {
    max-height : 100px;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!