[英]CSS not being applied to page
我目前有一個相當簡單的頁面,由於某種原因,沒有應用maincss.css,它只是將背景設置為圖像。 我知道它有效,因為在我添加另一個CSS文件進行jquery樣式之前它已經起作用了。 那怎么了?
<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>
看來您可能會遇到問題,因為:
body{}
標簽沒有被覆蓋。 為了解決問題:嘗試通過將background-color
配置為某種顏色來檢查CSS並進行測試。 這樣,您可以確保CSS正常運行,並嘗試其他選項。
嘗試這個
<!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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.