[英]Strange behavior of firefox and Chrome for JSP
我有一個奇怪的問題,我被要求使用許多Web技術制作一個Spring MVC簡單應用程序。 目前我正在2.2修改這個Spring MVC Step-By-Step Tutorial第2部分 。我被要求使用CSS樣式格式化來展示JSP。 好的,我做到了,但問題是,當我使用Firefox時,除了背景顏色外,它沒有顯示CSS格式。 但是當我使用chrome時,它會向我顯示CSS完整格式。
<html>
<head>
<style type="text/css">
body{
background-color: #C1CDCD;
background-image:url("logo.gif');
background-repeat:no-repeat;
background-position:right bottom;
margin-right:200px;}
h1{
font-style:oblique;
color:red;
text-align:center;
}
p#p1
{
font-style:italic;
font-family:"Times New Roman";
font-size:18px;
}
p#p2
{
font-style:thick;
font-family:"Times New Roman";
font-size:18px;
}
.colortext_thick{
font-style:normal;
font-weight:bold;
color:green;
}
.italictext{
font-style:italic;
}
</style>
<title>Hello :: Spring Application</title>
</head>
<body>
<h1>Hello World - Spring MVC Application</h1>
<p id="p1" class="italictext">Greetings. This is also my first CSS type format example..</p>
<p id="p2" class="colortext_thick">It is now <c:out value="${now}"/></p>
</body>
</html>
我無法弄清楚什么是問題,問題出在哪里。 首先我認為我的代碼有問題但是當我在chrome上訪問相同的應用程序時,它看起來非常好。 請幫忙。 謝謝
編輯:以下是Firefox和Chrome運行應用程序的示例圖像
看這里,
background-image:url("logo.gif');
開盤價和收盤價不匹配。 Firefox顯然在那時停止了解析CSS。
讓他們匹配:
background-image:url("logo.gif");
background: url("logo.gif');
有一個拼寫錯誤background: url("logo.gif');
你以雙引號開頭並以單引號結尾。用這個替換你的身體選擇器它應該有效。
body {
background: #C1CDCD;
background: url("logo.gif");
background-repeat:no-repeat;
background-position:right bottom;
margin-right:200px;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.