Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser compatibility with CSS

Status
Not open for further replies.

maxpower1

Programmer
Jul 29, 2001
488
US
a question about CSS; I am trying to simplify my coding by using css. I have a simple global.css file that has these statements:

body {
background: white;
}

then in the html file i have these lines:-

<html>

<head>
<link rel=&quot;stylesheet&quot; href=&quot;global.css&quot;>
</head>

<body>

</body>
</html>


it seems to be working on Nestcape 7 but not IE 6. In short, it does not change the background to white under IE but it does so under nestcape.
Any clues?

thx
 
Hey,

right - What you are prob looking for is to use:
background-color: white;

You can use just background to change the colour, this is shorthand CSS.
There is a good article about the background shorthand (and other CSS Shorthands) at

You may also want to change your link to your CSS file by adding type=&quot;text/css&quot; so that the browser knows how to render the file.
<link rel=&quot;stylesheet&quot; href=&quot;global.css&quot; type=&quot;text/css&quot;>

And - if I was going to get picky - You need to have a DTD (Document Type Definition) at the top of your HTML page.
You can find a good overview of DTD's at
My guessing is that you will need HTML 4 :
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>

hope this helps!!

M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top