Results 1 to 5 of 5

Thread: Background color

  1. #1
    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

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 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&#37; 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
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    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?

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Pretty sure, but again not 100&#37;.
    "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
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •