jQuery mobile layout

jQuery mobile layout

Hi, this may be more of a html /css layout question but I'm using jQuery mobile so I'm wondering if there's an easier way of doing it. It's for a mobile design so I've made it that when the screen is resized the page content also resizes. 

My current problem is (given my code below): This works fine in a browser, even when resizing the window to a certain extent but when I open it on my phone it's all messed up as shown in the screenshot (Windows phone, internet explorer....). I'm not massively familiar with responsive web design is there something I'm doing wrong here?


  1. EXAMPLE.HTML
  2. <!doctype html>
  3. <html>
  4. <head>
  5.    
  6.     <link rel="stylesheet" href="css/jquery.mobile-1.4.0.css"/>
  7.     <link rel="stylesheet" href="example.css"/>
  8.     <script src="js/jquery.js"></script>
  9.     <script src="js/jquery.mobile-1.4.0.min.js"></script>
  10. </head>
  11. <body>
  12.     <div data-role="page" id ="home">  

  13.         <div data-role="header" id="header" data-position="fixed"></div>
  14.         
  15.         <div data-role="content" class ="content">

  16.             
  17.             <div id="box" class="">
  18.                 <div id="small"></div>
  19.                 <p class="heading">div1</p>
  20.             </div>

  21.             <div id="box">
  22.                 <div id="small"></div>
  23.                 <p class="heading">div2</p>
  24.             </div>

  25.             <div id="box">
  26.                 <div id="small"></div>
  27.                 <p class="heading">div3</p>
  28.             </div>

  29.             <div id="box">
  30.                 <div id="small"></div>
  31.                 <p class="heading">div4</p>
  32.             </div>

  33.             <div id="box">
  34.                 <div id="small"></div>
  35.                 <p class="heading">div5</p>
  36.             </div>
  37.         </div>  
  38.     </div>
  39.  </body>
  40. </html>

  41. EXAMPLE.CSS
  42. html,body
  43. {
  44.     height:100%;
  45.     width:100%;
  46.     font-family: 'Istok Web', sans-serif;
  47.     background-color: red;
  48. }

  49. #home
  50. {
  51.     display:table;
  52.     width:100%;
  53.     height:100%;
  54. }

  55. #header
  56. {
  57.     width: 100%;
  58.     display:table-row;
  59.     height:8%;
  60. }
  61. .content
  62. {
  63.     height:100%; 
  64.     margin: 0px;
  65. padding:0px; 
  66. }

  67. #box
  68. {
  69. width:100%;
  70. height:19.5%;
  71. border: solid 1px #000000;
  72. position:relative;
  73. }

  74. #small
  75. {
  76. height: 100%;
  77. width:100px;
  78. border-left:solid 1px #000000;
  79. border-right: solid 1px #000000;
  80. float: left;
  81. } 
  82. .heading
  83. {
  84. font-size: 2em;
  85. position: absolute;
  86. margin-left: 110px;
  87. }



On my desktop (Good)                                                           On my phone (bad)