Results 1 to 2 of 2

Thread: Can I set the background color of a wrapper div?

  1. #1
    Join Date
    Jul 2009

    Question Can I set the background color of a wrapper div?

    I'm trying to set up a website for a friend and I'm having trouble getting a background color where i want it..

    The structure is standard:
    <div id="wrapper">
    	<div id="header">
    		<!--content removed for simplicity's sake-->
    	<div id="container">
    		<!--content removed for simplicity's sake-->
    	<div class="sidebar">
    		<!--content removed for simplicity's sake-->
    	<div id="footer">
    		<!--content removed for simplicity's sake-->
    and here is the CSS:
    body {
    	margin: 0;
    	font-family: Arial, Helvetica, Georgia, Sans-serif;
    	font-size: 12px;
    	text-align: center;
    	vertical-align: top;
    	background: #bdded5; <--this color shows up where i expect the wrapper div to make it white
    	color: #000000;
    	margin: 0 auto 0 auto;
    	width: 750px;
    	text-align: left;
    	background: #FFFFFF; <--this is what doesn't work
            overflow: hidden; <---- update to this post, i have found that adding this fixes the problem, but it seems counterintuitive--does anyone know what makes this work? It seems like it should hide everything... 
    	float: left;
    	width: 750px;
    	float: left;
    	width: 530px;
    	float: left;
    	width: 210px;
    	background: #eeeeee;
    	margin: 0 0 0 10px;
    	display: inline;
    	clear: both;
    	float: left;
    	width: 750px;
    	padding-top: 10px;
    The site is supposed to be a 750px wide (centered with white background), and outside of that (the space that is left over to the left and right) should be #bdded5.

    Any help will be greatly appreciated!
    Last edited by realmuffin; 08-14-2009 at 04:19 PM. Reason: found a solution

  2. #2
    Join Date
    Dec 2005
    American, living in Toronto, ON. CANADA
    the correct syntax when just one declaration/value is used, is:


    You can leave off "color" when you use several declarations in one selector

    for instance, adding an image with a background-color, becomes:

    background: #fff url(path/filename.ext) center center no-repeat
    I build for: Firefox and tweak for IE

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

Recent Articles