Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<title>Insert Notes</title>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta http-equiv='cache-control' content='no-cache' />
<meta http-equiv='pragma' content='no-cache' />
<meta http-equiv='expires' content='0' /><link rel='stylesheet' type='text/css' href='/test.css' />
</head><body>
<h1>Beer</h1>
<p>test</p>
</body></html>
And this is the CSS:
body{ background-color: gray;}
p { color: blue; }
h1{ color: white; }
Stick to one from:
[w3.org...]
E.g. the xhtml1. transitional one is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The validator at [validator.w3.org...] usually will flag such problems.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Insert Notes</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" /><link rel="stylesheet" type="text/css" href="/test.css" />
</head><body>
<h1>Beer</h1>
<p>test</p>
</body></html>
With that code, the CSS has no effect. Removing the doctype makes the CSS work. I have two test pages online, should I provide links?
Removing, or an invalid, doctype causes Quirks Mode, There's nothing wrong with either snippet you posted, so it's either something else in your CSS or something in the server, or a caching issue?
Did you try this on a different server and domain?