Go Back   Dynamic Drive Forums > General Coding > CSS
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-27-2007, 02:01 AM
TimFA TimFA is offline
Regular Coders
 
Join Date: Mar 2007
Location: Tarboro, NC
Posts: 290
Thanks: 8
Thanked 2 Times in 2 Posts
Default Background color

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:
Code:
#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:
Code:
<!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
Reply With Quote
  #2  
Old 08-27-2007, 02:06 AM
thetestingsite's Avatar
thetestingsite thetestingsite is online now
The Guy That Moderates
 
Join Date: Sep 2006
Location: St. George, UT
Posts: 2,795
Thanks: 3
Thanked 156 Times in 154 Posts
Default

In your css, change to the following:

Code:
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% on this though.
__________________
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
The Testing Site | Atomic Yeti
Reply With Quote
  #3  
Old 08-27-2007, 02:15 AM
TimFA TimFA is offline
Regular Coders
 
Join Date: Mar 2007
Location: Tarboro, NC
Posts: 290
Thanks: 8
Thanked 2 Times in 2 Posts
Default

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?
Reply With Quote
  #4  
Old 08-27-2007, 02:16 AM
thetestingsite's Avatar
thetestingsite thetestingsite is online now
The Guy That Moderates
 
Join Date: Sep 2006
Location: St. George, UT
Posts: 2,795
Thanks: 3
Thanked 156 Times in 154 Posts
Default

Pretty sure, but again not 100%.
__________________
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
The Testing Site | Atomic Yeti
Reply With Quote
  #5  
Old 08-27-2007, 02:18 AM
TimFA TimFA is offline
Regular Coders
 
Join Date: Mar 2007
Location: Tarboro, NC
Posts: 290
Thanks: 8
Thanked 2 Times in 2 Posts
Default

Well thanks anyways. And thanks for the quick response. Usually it takes longer.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:38 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.