Jquery Mobile Multiline Button

情到浓时终转凉″ 提交于 2019-12-22 08:46:57

问题


How can I set this button multiline?

<a style="width:33%; display:inline-block; " href="/foos.html"  data-role="button" data-icon="arrow-l">a lot of text </a>

回答1:


The above answer given by ppshein is incorrect. It makes a bigger button but doesn't make the button multilined. The only thing you need to do is add the following css:

.ui-btn-inner { 
  white-space: normal !important; 
}

It works both for button and input tags.

Btw there's a bug for IE: the text in the button isn't clickable. The fix is found at github:

https://github.com/timmywil/jquery-mobile/commit/59a4946d776e9b1f6a75e9eb53ccb38347612125




回答2:


It's simple. Change existing .ui-btn-inner class as follow.

.ui-btn-inner { 
    padding: 2em; 
    display: block; 
    height: 100%; 
    text-overflow: ellipsis; 
    overflow: hidden; 
    white-space: nowrap; 
    position: relative; 
}

after that, change existing two class as follow

<!--- add it after .ui-select ---> 
.ui-select .ui-btn-inner {padding: .6em;} 

<!--- add it after .ui-checkbox ---> 
.ui-checkbox .ui-btn-inner {padding: .6em;}

You can visit my blog for detail

How to make square shape button in jQueryMobile



来源:https://stackoverflow.com/questions/7453926/jquery-mobile-multiline-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!