Search code examples
cssgoogle-chromestylesheet

Chrome not loading stylesheet for nearly identical pages


http://azlro.org/chad/1991rrchunter.html loads correct, with black background image in Chrome and Explorer. The code:

`<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 does not load the stylesheet in Chrome and thus has a white background instead of the black background image above. However, it will load the black background image and follow the stylesheet in Explorer, with the same stylesheet being used for both links. The code:

`<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>`

This has been driving me nuts for months.

Is there something I'm not seeing that I need to correct in the code for the second link?


Solution

  • The second Page is UTF-16 Encoded therefore the wrong characters in the Stylesheet. What you need is UTF-8

    Start your html Document properly like:

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

    The <!DOCTYPE html> should ensure that Quirks Mode is not used.

    Dont forget to close <html> and <head> tags (No need to close the "DOCTYPE" Tag.