我目前有一个相当简单的页面,由于某种原因,maincss.css没有被应用,它只是简单地将背景设置为图像。我知道它的工作原理是在我为jquery样式添加另一个css文件之前工作。那么这是错误的?CSS没有应用到页面
<html xmlns=\ "http://www.w3.org/1999/xhtml\" xml:lang=\"en\">
<head>
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
<title>Welcome to Jetty-9</title>
<link href="css/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<link href="css/maincss.css" rel="stylesheet">
<script type='text/javascript' src='js/jquery.js'></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {
$("#dialog").dialog({
width: 400,
buttons: [
{
text: "Ok",
click: function() {
$(this).dialog("close");
}
},
{
text: "Cancel",
click: function() {
$(this).dialog("close");
}
}
]
});
});
</script>
</head>
<body>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
</body>
</html>
上面的代码没什么问题,请使用chrome或firefox,看看你有没有错误或警告,当你检查元素或按F12。谢谢 – abc123
我不相信任何路径是不正确的,因为当我查看页面源并单击它们正确打开的每个.js和.css文件时 – AggieDev
图像的路径是否正确? – Mathletics