更改jQuery手机中按钮文本的字体大小

更改jQuery手机中按钮文本的字体大小

问题描述:

我在fieldset中有2个jQuery手机按钮,并且想要更改其中一个按钮的font-size。我尝试添加内联样式,但没有奏效。更改jQuery手机中按钮文本的字体大小

我也试过,但没有工作的孔:

.myButton 
{ 
    word-wrap: break-word !important; 
    white-space: normal !important; 
} 

这是正在发生的事情:(仅适用于iPhone)

enter image description here

因为屏幕尺寸iPhone的“请求更改”按钮正在被切断。

有没有办法让我改变按钮文本的font-size,以便它显示完整的文本而不会被截断?


HTML:

<fieldset class="ui-grid-a"> 
    <div class="ui-block-a"> 
     <input data-mini="true" type="submit" value="Cancel" name="Submitbutton" class="button button-link"/> 
    </div> 
    <div class="ui-block-b"> 
     <input data-mini="true" data-theme="b" type="submit" value="Request Change" name="Submitbutton" class="button button-link" /> 
    </div> 
</fieldset> 

我曾尝试:

+0

你有没有试过''''font-size'值? – jzacharia 2012-07-26 15:54:25

+0

是的,我已经尝试过。没有运气:( – 2012-07-26 16:16:09

播放具有以下找到什么是最好的iPhone屏幕

.ui-btn-inner{ 
    text-overflow: initial; /* Get rid of the ellipsis */ 
    padding-left: 5px; /* Play with padding to make max use of available button width */ 
} 
.ui-btn-text { 
    font-size: 15px; /* Play with font size of the text */ 
} 
+0

正是我在找的东西。谢谢:) – 2012-07-26 16:53:43

+0

@Nirmal Patel:这应该是*文本溢出:继承; *而不是*初始*? – mithunsatheesh 2012-09-07 09:49:24

+3

问题在于它影响所有按钮 – dsdsdsdsd 2014-02-03 22:47:16

活生生的例子:

JS:

// For all buttons use something like this 
$('.ui-btn').css('width','50%'); 

// For individual buttons use something like this 
$('#theButton1').parent().css('width', '75%'); 

// Or this for HREF data-role buttons 
$('#hrefButton4').css('width', '45%'); 

// this changes the height for all buttons 
$('.ui-btn-text').css('font-size','50px'); 

// This changes the height for a single element 
$('#hrefButton3').children().children().css('font-size','30px'); 

我想你希望做这样的事情:

$('#hrefButton3').children().children().css('font-size','10px'); 

HTML:

<div data-role="page" id="home"> 
    <div data-role="content"> 
     <input type="button" id="theButton1" value="Press Me 1" /> 
     <input type="button" id="theButton2" value="Press Me 2" /> 
     <input type="button" id="theButton3" value="Press Me 3" /> 
     <input type="button" id="theButton4" value="Press Me 4" /> 
     <br /> 
     <a href="#" data-role="button" id="hrefButton1">HREF Me 1</a> 
     <a href="#" data-role="button" id="hrefButton2">HREF Me 2</a> 
     <a href="#" data-role="button" id="hrefButton3">HREF Me 3</a> 
     <a href="#" data-role="button" id="hrefButton4">HREF Me 4</a> 
    </div> 
</div> 

相关:

+0

这是一个很好的解决方案,但在我的情况下,Nirmal的解决方案对我更好。感谢您的帮助:) – 2012-07-26 16:54:57