本文介绍了jQuery Mobile多行按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置此按钮的多行显示?

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>

推荐答案

ppshein给出的上述答案不正确.它使按钮更大,但不会使按钮成为多行显示.您唯一需要做的就是添加以下CSS:

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.

顺便说一句,IE浏览器存在一个错误:按钮中的文本不可单击.该修补程序位于github:

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/59a4946d776e9b1f6a75e12eb125

这篇关于jQuery Mobile多行按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 17:38