Saturday, 24 August 2013

Jquery Mobile - Splitting a page into 4 Parts

Jquery Mobile - Splitting a page into 4 Parts

I`m using Jquery mobile and I want to split the page into four
parts(Fiddle) with header and footer enabled. But somehow it is not
working.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="http://code.jquery.com/mobile/1.1.2/jquery.mobile-1.1.2.min.css"
/>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script
src="http://code.jquery.com/mobile/1.1.2/jquery.mobile-1.1.2.min.js"></script>
<link rel="stylesheet" href="app.css"/>
</head>
<body>
<div data-role="page">
<div data-role="header" data-rel="back">
</div>
<div id="div1" class="a"></div>
<div id="div2" class="a"></div>
<div id="div3" class="a"></div>
<div id="div4" class="a"></div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
</div>
</body>
CSS
html, body { height: 100%; padding: 0; margin: 0; }
div.a { width: 50%; height: 50%; float: left; }
#div1 { background: #DDD; }
#div2 { background: #AAA; }
#div3 { background: #777; }
#div4 { background: #444; }
I can see only footer.. but that too at the top.. What am I doing wrong here?

No comments:

Post a Comment