2012-06-23 66 views
0

我有一个页面内置jQuery Mobile,我试图用CSS来插入背景,但这里已经有了这个灰色的背景。jQuery手机后台

我该如何摆脱它?

<!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>​ 
+0

你在说什么灰色背景。 – SVS

+0

请修复你的jsfiddle。您不能在jsfiddle中使用相对路径,因为它会链接到jsfiddle.net本身的文件。请以绝对路径重新发布。 –

回答

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> 

它工作正常。所以请检查一次你的图像路径是否正确。

谢谢

+0

我在测试你的答案,1秒 – Excalibur

+0

你得到了什么结果......我希望它能起作用。并请在图像的网址有不必要的空间,所以删除,在我的答案.. –

+0

对不起,不工作,我也修复了路径 – Excalibur