jQuery Mobile多行按钮

4
我该如何将此按钮设置为多行显示?
<a style="width:33%; display:inline-block; " href="/foos.html"  data-role="button" data-icon="arrow-l">a lot of text </a>
2个回答

9

我已经编辑了我的回答,IE浏览器中有一个错误,你可能需要修复。 - Tosh
1
好的,但是我正在开发的网站是为移动设备设计的,所以我最终可以说我不在乎IE了,不过还是谢谢。 - Christophe Debove

-1

很简单。将现有的.ui-btn-inner类更改为以下内容。

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

接下来,将现有的两个类更改如下:

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

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

您可以访问我的博客了解详情

如何在jQueryMobile中制作正方形按钮


好的,我有一个多行布局(正方形),但我的文本不会换行。 - Christophe Debove
我不明白为什么要在多行文本中使用text-overflow: ellipsis;,因为这似乎是不合逻辑的。 - Christophe Debove

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接