Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
重新设置JQueryMobile的样式-更改文本框的宽度_Jquery_Css_Jquery Mobile - Fatal编程技术网

重新设置JQueryMobile的样式-更改文本框的宽度

重新设置JQueryMobile的样式-更改文本框的宽度,jquery,css,jquery-mobile,Jquery,Css,Jquery Mobile,除了基本掌握JQueryMobile之外,我发现自己还想在引擎盖下做一点改变。考虑这些表单元素: 我想要: from $37,400 up to $[textbox here] 在一条线上。我怎样才能改变一些文本框的宽度,并保持它的“移动”外观 <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8">

除了基本掌握JQueryMobile之外,我发现自己还想在引擎盖下做一点改变。考虑这些表单元素:

我想要:

from $37,400 up to $[textbox here]
在一条线上。我怎样才能改变一些文本框的宽度,并保持它的“移动”外观

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <title> - jsFiddle demo</title> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>  

  <style type='text/css'>

  </style>

<script type='text/javascript'>//<![CDATA[ 

</script>
</head>
<body>
<div data-role="page" id="calcs" data-add-back-btn="true">
    <div data-role="header" data-position="fixed">
        <h1>graphics2</h1>
    </div>
    <div data-role="content">
        <form action="#" method="get">
            <div  id="ratelist">
                <legend><b>Ordinary Tax Rates</b></legend>
                <div data-role="fieldcontain">
                    <input type="range" name="slider" id="rate4" value="30" min="0" max="100" data-highlight="true" data-mini="true" />up to $: <br/>                           
                    <input type="text" name="name" id="name" value="178653" data-mini="true"/><br/>
                </div>
                <div data-role="fieldcontain">              
                <label for="slider">% rate:</label>
                    <input type="range" name="slider" id="rate5" value="33" min="0" max="70" data-highlight="true" data-mini="true" /><br/>
                    <label for="slider">up to $</label>
                    <input type="range" name="slider" id="upto5" value="388350" min="0" max="3000000" data-highlight="true" data-mini="true" /><br/>
                </div>
            </div>
    </form>
    </div>
    <div data-role="footer" data-position="fixed">
        <h4>test</h4>
    </div>
</div> 
</body>
</html>

-JSFIDLE演示
//
图形2
普通税率
最多$:

%费率:
最多$
测试
您可以使用CSS以表单输入为目标,并更改元素的任何CSS属性。如果要更改
#name
元素的
宽度
,请将此CSS添加到文档中:

#name {
    width : 200px;
}​
下面是一个演示:

由于
#name
不是一个非常唯一的ID,可能会在不经意间多次添加到站点,因此您可以在CSS规则中指定哪个页面:

#calcs #name {
    width : 200px;
}​

遗憾的是,这在jqm1.3.0(使用jq1.9)中已经停止工作:@Marc现在看来,