jquerymobile下label和input輸入框小屏幕不在同一行顯示

這幾天在學jqm,遇到這問題百度了好久,google到了國外的技術論壇都找不到合適的答案,有的人說是改自定義css樣式 @media (max-width: 480px) ,但是我試了卻沒用,還有的說是改label的寬度,我改了沒用。最後偶然發現去掉
<div data-role="page" data-fullscreen="true">
中的
data-fullscreen="true"

就可以了。去掉之前的效果圖


去掉之後的效果圖


但是我還是不知道原理是什麼,有知道的大神不只能否解釋下?

代碼如下:

  <!DOCTYPE html>
  <html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>demo2</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" type="text/css" href="CSS/jquery.mobile-1.3.2.min.css">
  <script type="text/javascript" src="JS/jquery.js">
  </script>
  <script type="text/javascript" src="JS/jquery.mobile-1.3.2.min.js">
  </script>
  <script>
  $(document).ready(function() {
	//$(".ui-radio").css("width","50%");
    $(":submit").click(function(){
		var a;
		a=$("#count").val();
		var b=a.match(/\w+/g);
		if(b==null){
		alert("輸錯了!");
		return false;}
		})
});
  </script>
  </head>
  <body>
  <div data-role="page" data-fullscreen="true">
  <div data-role="header" style="height:10%">
  <div style="text-align:center;height:100%"><span>Register</span></div>
  </div>
  <div data-role="content">
  <form action="#" method="post">
  <div data-role="fieldcontain">
  <label for="count"><b>學號:</b></label>
  <input type="text" name="count" id="count" data-di/>
  </div>
  <div data-role="fieldcontain">
  <label for="pwd">密碼:</label>
  <input type="password" name="pwd" id="pwd"/>
  </div>
  <div data-role="fieldcontain">
  <label for="nickname"><b>暱稱:</b></label>
  <input type="text" name="nickname" id="nickname"/>
  </div>
  <fieldset data-role="controlgroup">
  <legend><b>戀愛狀態:</b></legend>
  <label for="single">單身</label>
  <input type="radio" name="lstate" id="single" value="single"  data-theme="b">
  <label for="loving">熱戀ing</label>
  <input type="radio" name="lstate" id="loving" value="loving"  data-theme="b">
  </fieldset>
  <div style="margin:auto;width:60%">
  <div style="float:left;width:40%"><input type="submit" value="提交" data-theme="b" /></div>
  <div style="float:right;width:40%"><input type="reset" value="重寫" data-theme="b" /></div>
  </div>
  </form>
  </div>
  <div data-role="footer" data-position="fixed" data-transition="slideup">
  <div style="text-align:center;height:40%">copyright by 飄雪工作室</div>
  </div>
  </div>
  </body>
  </html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章