我有.jsp
个文件
<!doctype html>
<html lang="en">
<head>
<title>Calendar</title>
<h1><div align="center">My Sunlife App</div></h1>
<meta charset="utf-8">
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="cssFiles/BackgroundIMGE.css" media="screen">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type = "text/javascript" language = "javascript">
$(document).ready(function() {
$("#datepicker").datepicker();
});
</script>
</head>
它使用css文件(BackgroundIMGE.css
)来设置背景图像。我已将此css文件放在Workspace\MySunlifeApp\cssFiles\BackgroundIMGE.css
中。
使用此功能的应用程序名称为MySunlifeApp
。
css文件是:
body {
background-image: url(/asd.jpg); /*You will specify your image path here.*/
-moz-background-size: cover;
-webkit-background-size: cover;
background-size: cover;
background-position: top center !important;
background-repeat: no-repeat !important;
background-attachment: fixed;
}
此处asd.jpg
也与CSS文件位于同一文件夹中。
当我运行应用程序时,它没有加载CSS文件。
http://localhost:8090/MySunlifeApp/cssFiles/BackgroundIMGE.css Failed to load resource: the server responded with a status of 404 (Not Found)