Two color background with CSS

I need to have a a two-tone background go all the way down the page. I want the exact middle of the page all the way to the right to be yellow and from the middle of the page all the way left to be green. How would I do this? Could someone show me how.

Thanks so much!
turtleman2009Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gracemediaCommented:
The attached code should do the trick... Just create a new html file and place the following code in it. Good Luck!
<!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>
 
<body style="padding:0; margin:0;">
	<div style="position:absolute; width:100%" align="center">
	<div style="width:900px; margin:0px auto;">Your Content Goes Here</div>
</div> 
    
<div style="background:#006600; width:50%; height:100%; z-index:2; position:absolute">&nbsp;</div>
    
	<div style="background:#FFFF00; width:50%; height:100%; position:absolute; right:0px;">&nbsp;</div>
</body></html>

Open in new window

0
gracemediaCommented:
I messed up the layering on my first post. Try this one instead so your content will appear on top of the background...
<!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>
 
<body style="padding:0; margin:0;">
	<div style="position:absolute; width:100%; z-index:200;" align="center">
	<div style="width:900px; margin:0px auto; z-index:300;">Your Content Goes Here</div>
</div> 
    
<div style="background:#006600; width:50%; height:100%; z-index:2; position:absolute">&nbsp;</div>
    
	<div style="background:#FFFF00; width:50%; height:100%; position:absolute; right:0px;">&nbsp;</div>
</body></html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
turtleman2009Author Commented:
Awesome! This is exactly what I needed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.