Re cant change background color using external style sheet

S

Simon

I cant change background color using my external style sheet title
teststylesheet.css

<style type="text/css">
body { background-color: black;}
</style>


And in the document I have the link

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>

<title>Test</title>


<link rel=" stylesheet " type="text/css" href="teststylesheet.css" />

</head>

<body>
the test is not working

</body>
</html>


I have been through this and I can"t find anything wrong can any one
help
Regards
 
S

Steve Pugh

I cant change background color using my external style sheet title
teststylesheet.css

<style type="text/css">
body { background-color: black;}
</style>

Why do you have HTML in your CSS file?
Get rid of the HTML and just keep the CSS.

I hope that you'll real stylesheet sets a color as well. Always set
color and background-color together to avoid clashes with user
stylesheets.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Here you say that it's HTML ...
<link rel=" stylesheet " type="text/css" href="teststylesheet.css" />

.... and here you use XHTML syntax.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top