在iphone上我有一个表格:
我想:
from $37,400 up to $[textbox here]
在同一条线上。在横向模式下,无论我在多大程度上削减文本宽度,它都可以工作但不是纵向。我正在寻找一种可以覆盖的风格。您可以通过打开http://jsfiddle.net/mckennatim/xwFW9/1/并缩小浏览器页面来模拟问题。
<!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'>
#upto4 {
width: 65px;
margin-left: 5px;
margin-right: 5px;
}
</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/>
<p id="spupto4"> from $84,600 to
<input type="text" name="nupto4" id="upto4" value="178653" data-mini="true"/>
</p><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>
答案 0 :(得分:0)
到风格:
<style type='text/css'>
#upto4 {
width: 65px;
margin-left: 5px;
margin-right: 5px;
}
添加display:inline-block;覆盖display:block;
<style type='text/css'>
#upto4 {
width: 65px;
margin-left: 5px;
margin-right: 5px;
display: inline-block;
}