LiveWire Peer Support Network

Printable Version of Topic "CSS (Seperate Backgrounds??)"

- LiveWire Teen Forums & College Forums (http://www.golivewire.com)
-- (http://www.golivewire.com/forums/support-technical.html)
--- Web Design & Search Engine Optimization (http://www.golivewire.com/forums/forum-200-s-0.html)
---- CSS (Seperate Backgrounds??) (http://www.golivewire.com/forums/peer-ynbtoin-support-a.html)


-- Posted by Awesome10 at 6:44 am on July 2, 2009

Okay so i've got a website and i have the body aligned in the center to 1000px. How can i make the 1000px body background colour be one colour and then the two empty spaces on both sides of it to be another colour?

Here is a picture of what my website is like:

|C2|  C1  |C2|
|C2|  C1  |C2|
|C2|  C1  |C2|

C1 = Body (aligned to 1000px), I want the background colour of this to be White.

C2 = blank spaces on sides of the body, i want this to be black.

How can i do this? is there any css code for this?


-- Posted by JamesBrauman at 7:00 am on July 2, 2009

Don't do that at all, you're not supposed to align the body. What you need are div's. Div's are basically containing blocks, used all throughout CSS. Like everywhere. I'll write you some sample code hold on, stay on lol.


-- Posted by JamesBrauman at 7:03 am on July 2, 2009

So your html would look like this:
Code:


   
   

   ...
   

 

And your css would look like this:
Code:

body {
 background: black;
}

#container {
 width: 1000px;
 margin: 0 auto;
 height: 1000px;  // For example purposes
 background: white;
}


-- Posted by Narfled the Garthok at 7:04 am on July 2, 2009

Dude above gave you all the css you need :P


-- Posted by JamesBrauman at 7:04 am on July 2, 2009

Sorry if that doesnt make sense I'm a bit high.


-- Posted by JamesBrauman at 7:06 am on July 2, 2009

Quote: from Narfled the Garthok at 7:04 am on July 2, 2009


Dude above gave you all the css you need :P

I'm an awesome dude.


-- Posted by Awesome10 at 7:07 am on July 2, 2009

Thanks man! ill try it out and get back to you =]


-- Posted by JamesBrauman at 7:11 am on July 2, 2009

No problems


www.golivewire.com