jquery mobile individual page background
Adding an image to a jquery mobile page and unable to prevent it from repeating. OK for mobile 开发者_运维知识库devices but when viewed on tablet or desktop it is not OK to repeat' Thanks!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Mobile Web App</title>
<link href="../jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet"
type="text/css"/>
<script src="../jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script>
<script src="../jquery-mobile/jquery.mobile-1.0a3.min.js"
type="text/javascript"></script>
</head>
<body>
<div data-role="page" id="page1" data-theme="b" style="background-
image:url(images/bkgrnd-7.jpg)">
<div data-role="header">
<h1>Page One</h1>
</div>
</div>
<div data-role="content">
Content
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div>
<!--Additional pages and content with their own backgrounds...-->
</div>
</body>
</html>
background:url(images/bkgrnd-7.jpg) no-repeat;
You would add the CSS property no-repeat
to the background image and make it dependent on the media rules property of CSS3.
@media screen /*Computer screen*/
@media handheld /*Mobile devices*/
but keep in mind that a tablet may be considered a mobile device or a regular screen.
so you can do something like this
@media screen and (min-device-width: 480px) and (max-device-width: 800px)
@media handheld and (min-device-width: 480px)
精彩评论