0

我有一个在 jQuery Mobile 中构建的页面,我正在尝试使用 css 插入背景,但是那里已经有了这个灰色背景。

我该如何摆脱它?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, target-densityDpi=device-dpi" />
<title>GeoBird</title>
<link href="jquery-mobile/jquery.mobile.theme-1.0.min.css" rel="stylesheet" type="text/css" />
<link href="jquery-mobile/jquery.mobile.structure-1.0.min.css" rel="stylesheet" type="text/css" />
<script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
 <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
</head>
<body>
<div data-role="page" id="home">
  <div data-role="header">
    <h1>SketchUp</h1>
  </div>

<style>
#buttons {
position: absolute;
top: 200px;
left: 175px;}

body {
    background: url(background.jpg);
    background-repeat:repeat-y;
    background-position:center center;
    background-attachment:scroll;
    background-size:100% 100%;
}
</style>



<script language="javascript" type="text/javascript">
$(document).ready(function() {
    $("#quitbutton").click(function() {
        alert("clicked");
        navigator.app.exitApp();
    });
});
  </script>






<div id="buttons"> 
 <a  href="game.html" data-role="button" data-iconpos="bottom">Start</a>
 <a  href="" data-role="button" data-iconpos="bottom">Options</a>
  <a  href="" data-role="button" data-iconpos="bottom">Credits</a>
   <a  id="quitbutton" data-role="button" data-iconpos="bottom">Quit</a>
   </div>
</body>
</html>​
4

1 回答 1

0

在 JSfiddle 中,由于路径问题,它没有拍摄背景图像。请检查 css 中的图像路径是否正确。

我试图从谷歌图片添加背景图片,它工作正常。

<style>  
body {
      background: url('http://colorvisiontesting.com/plate%20with%205.jpg');
     background-repeat:repeat-y;
    background-position:center center;
    background-attachment:scroll;
    background-size:100% 100%;
    }
</style>

它工作正常。因此,请检查您的图像路径是否正确。

谢谢

于 2012-06-23T09:37:53.160 回答