我目前有一个相当简单的页面,由于某些原因,maincss.css没有被应用,它只是设置图像的背景。我知道它是有效的,因为在我为jquery样式添加另一个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>
发布于 2013-07-02 03:16:35
看起来你可能会遇到问题,因为:
CSS文件中的
body{}
标记被覆盖为空。对于分辨率:尝试通过将background-color
配置为某种颜色来检查CSS并对其进行测试。因此,通过这种方式,您可以确保CSS工作正常,同时也可以尝试其他选项。
发布于 2013-07-02 03:03:12
尝尝这个
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Script-Type" CONTENT="text/javascript">
<title>Welcome to Jetty-9</title>
<link type="text/css" href="css/jquery-ui-1.10.3.custom.css" rel="stylesheet" />
<link type="text/css" href="css/maincss.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="http://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>
https://stackoverflow.com/questions/17411685
复制相似问题