Log in

View Full Version : Background color



TimFA
08-27-2007, 01:01 AM
Hello, I have a page and I'm using CSS but I CANNOT set the page background color for some reason. Anyone know? Also it doesn't center in IE for me. I'm using IE6 on Win 2000 Pro.

Heres the CSS:


#body
{
background-color: #00FF00
}

div#top
{
margin-left: auto;
margin-right: auto;
height: 66px;
width: 600px;
font-family: Arial;
font-size: 10pt;
background-color: #FFFFFF;
border-bottom: 2px #D1D1D1 solid;
}

div#main
{
margin-left: auto;
margin-right: auto;
height: 700px;
width: 600px;
font-family: Arial;
font-size: 10pt;
background-color: #FFFFFF;
}

A:link
{
text-decoration: none; color: #0000FF;
}

A:visited
{
text-decoration: none; color: #0000FF;
}

A:hover
{
text-decoration: none; color: #000000;
}


Here's the HTML:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="css/layout.css"
type="text/css">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Fassist | Home</title>
</head>
<body>
<div id="top">
<br>
</div>
<div id="main"><br>
</div>
</body>
</html>


Thanks all.

Tim

thetestingsite
08-27-2007, 01:06 AM
In your css, change to the following:



BODY
{
background-color: #00FF00;
}

div#top
{
margin-left: auto;
margin-right: auto;
height: 66px;
width: 600px;
font-family: Arial;
font-size: 10pt;
background-color: #FFFFFF;
border-bottom: 2px #D1D1D1 solid;
}

div#main
{
margin-left: auto;
margin-right: auto;
height: 700px;
width: 600px;
font-family: Arial;
font-size: 10pt;
background-color: #FFFFFF;
}

A:link
{
text-decoration: none; color: #0000FF;
}

A:visited
{
text-decoration: none; color: #0000FF;
}

A:hover
{
text-decoration: none; color: #000000;
}


That will get the background color to work, but not sure about the centering in IE.

Hope this helps nonetheless.

//EDIT: I think that IE has a problem with "auto" in the margin css attributes. Not 100&#37; on this though.

TimFA
08-27-2007, 01:15 AM
I knew I needed the ";" faulty coding, I was trying different methods, the real problem was the "BODY". Thanks thetestingsite. I believe I can fix that with "text-align", correct?

thetestingsite
08-27-2007, 01:16 AM
Pretty sure, but again not 100&#37;.

TimFA
08-27-2007, 01:18 AM
Well thanks anyways. And thanks for the quick response. Usually it takes longer.