Chrome没有为几乎相同的页面加载样式表

时间:2018-05-07 12:04:20

标签: css google-chrome stylesheet

http://azlro.org/chad/1991rrchunter.html加载正确,Chrome和Explorer中带有黑色背景图片。代码:

`<html>
<head>
<title>My advice to other 1987 to 1995 Range Rover Classic Owners</title>
<link rel="stylesheet" type="text/css" href="style-TrainTunnel.css">
<meta name="author" content="Chad Manz">
<meta name="keywords" content="chad manz, range rover, range rovers, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, County, Great Divide Edition, GDE, Hunter, SWB, LWB, land rover, land rovers, upgrade, upgrades, modification, modifications, tips, advice, recommendation, recommendations">
<base target="_blank">
</head>
<body>
<p>
<center>
<br>
<table width="875">
<tr>
<td>`

http://azlro.org/chad/rrcadvice.html未在Chrome中加载样式表,因此具有白色背景而非上方的黑色背景图片。但是,它将加载黑色背景图像并按照资源管理器中的样式表,两个链接使用相同的样式表。代码:

`<html>
<head>
<title>My advice to other 1987 to 1995 Range Rover Classic Owners</title>
<link rel="stylesheet" type="text/css" href="style-TrainTunnel.css">
<meta name="author" content="Chad Manz">
<meta name="keywords" content="chad manz, range rover, range rovers, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, County, Great Divide Edition, GDE, Hunter, SWB, LWB, land rover, land rovers, upgrade, upgrades, modification, modifications, tips, advice, recommendation, recommendations">
<base target="_blank">
</head>
<body>
<p>
<center>
<br>
<table width="875">
<tr>
<td>`

这让我疯了几个月。

我有没有看到我需要在第二个链接的代码中更正?

1 个答案:

答案 0 :(得分:0)

第二页是UTF-16编码因此样式表中的字符错误。 你需要的是UTF-8

正确启动您的html文档,如:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
.
.
.
  

<!DOCTYPE html>应确保使用Quirks模式

不要忘记关闭<html><head>代码(无需关闭&#34; DOCTYPE&#34;代码。