Results 1 to 4 of 4

Thread: Container Div BG Color

  1. #1
    Join Date
    Jan 2009
    Location
    Chattanooga, TN
    Posts
    41
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default Container Div BG Color

    I have a div set up with 3 other divs inside of it, and the background color on the container div won't work. The color is supposed to be a dark blue and is showing correctly in Dreamweaver, but when I test it in the browsers (FF, IE) it shows as white (the body bg color.)

    This is a modified template, so I may be looking over something the author did, or it could be my error. Either way, I need some help.

    Here is the test page:
    http://www.freewebs.com/jessicahaggy.../Test_new.html

    And here is the code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <style type="text/css">
    html,body{
    margin:0;
    padding:0;
    }
    body{
    font: 76% arial,sans-serif;
    text-align:center;
    }
    p{
    margin:0 10px 10px;
    }
    a{
    display:block;
    padding:10px;
    }
    div#header h1{
    	height:80px;
    	line-height:80px;
    	margin:0;
    	padding-left:10px;
    }
    div#header{
    background-color: #1e6490;
    }
    div#container{
    	text-align:left;
    	background-color: dff4f7;
    	width:748px;
    	margin:0 auto;
    	z-index: 0;
    	background-color: dff4f7;
    }
    div#content {
    background:#b8d7e2;
    }
    div#navigation{
    background:#b8d7e2;
    }
    div#extra{
    background:#b8d7e2;
    }
    div#footer{
    background-color: #1e6490;
    }
    div#footer p{
    margin:0;
    padding:5px 10px;
    }
    
    div#content{
    	float:left;
    	width:423px;
    	margin-top:46px;
    	margin-left:33px;
    	margin-bottom: 46px;
    	background-color: b8d7e2;
    	z-index: 10;
    }
    div#navigation{
    	float:right;
    	width:230px;
    	margin-top:46px;
    	margin-right:32px;
    }
    div#extra{
    	float:right;
    	clear:right;
    	width:230px;
    	margin-top:16px;
    	margin-right:32px;
    	background-color: b8d7e2;
    }
    div#footer{clear:both;width:100%}
    </style>
    </head>
    <body>
    <div id="container">
    <div id="header"><h1>Header</h1></div>
    <div id="wrapper">
    <div id="content">
    <p><strong>1) Content here.</strong> column long long column very long fill fill fill long text text column text silly very make long very fill silly make make long make text fill very long text column silly silly very column long very column filler fill long make filler long silly very long silly silly silly long filler make column filler make silly long long fill very.</p>
    <p>very make make fill silly long long filler column long make silly silly column filler fill fill very filler text fill filler column make fill make text very make make very fill fill long make very filler column very long very filler silly very make filler silly make make column column </p>
    <p>fill long make long text very make long fill column make text very silly column filler silly text fill text filler filler filler make make make make text filler fill column filler make silly make text text fill make very filler column very </p>
    <p>column text long column make silly long text filler silly very very very long filler fill very fill silly very make make filler text filler text make silly text text long fill fill make text fill long text very silly long long filler filler fill silly long make column make silly long column long make very </p>
    </div>
    </div>
    <div id="navigation">
    <p><strong>2) Navigation here.</strong> long long fill filler very fill column column silly filler very filler fill fill filler text fill very silly fill text filler silly silly filler fill very make fill column text column very very column fill fill very silly column silly silly fill fill long filler </p>
    </div>
    <div id="extra">
    <p><strong>3) More stuff here.</strong> very text make long column make filler fill make column column silly filler text silly column fill silly fill column text filler make text silly filler make filler very silly make text very very text make long filler very make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p>
    </div>
    <div id="footer"><p>Footer</p></div>
    </div>
    </body>
    </html>
    Thanks all.
    Last edited by dillankid; 01-12-2009 at 07:58 PM. Reason: Resolved.

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Ah this one should be simple, you've omitted to put the "#" symbol in front of the colour code. Please change the CSS to the following and it should solve the problem:

    Code:
    div#container{
    	text-align:left;
    	background-color: #dff4f7;
    	width:748px;
    	margin:0 auto;
    	z-index: 0;
    	background-color: #dff4f7;
    }
    Hope this helps.
    Last edited by Schmoopy; 01-12-2009 at 07:56 PM.

  3. The Following User Says Thank You to Schmoopy For This Useful Post:

    dillankid (01-12-2009)

  4. #3
    Join Date
    Jan 2009
    Location
    Chattanooga, TN
    Posts
    41
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default

    lol...that was simple. It's fixed, thanks. I think I need to take a break...I'm making stupid mistakes...

  5. #4
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    No problem, it's sometimes hard to spot errors in your own code as you've been looking at it for a long time and are likely to miss things, so it's always good to get someone else to look through it - or take a break .

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
  •