Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Matt Bell
197 Pointshow to set how big the background color is
Hey so i want to make my background color like only half the page so i can have one color half the page and the other white this is the code i have
body {
background-color: #4686a0;
}
really not sure what to do next can anyone help
thanks
1 Answer

Christian Andersson
8,712 PointsThe background-color
property only sets the color of the elements that you're styling. If you want to have 2 colors you have to create a second element that has a different background-color
.
Example 1: http://codepen.io/anon/pen/xGYJEa
Example 2: http://codepen.io/anon/pen/QbQBGd

Matt Bell
197 PointsWow thanks that really has helped and made sense to me now thanks so much !

Christian Andersson
8,712 PointsNo worries, glad I could help!
Perry Eising
12,663 PointsPerry Eising
12,663 PointsHi Matt,
you can't really have two colours as your background unless you want it to be a gradient.( check out css gradients if that is what you are looking to do.)You can do things like have a DIV that takes up half the page have a different background than your page background, for example.