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! While you're at it, check out some resources Treehouse students have shared here.
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
Dewayne Thomas
Courses Plus Student 10,283 PointsWeb Design(HTML/CSS)
Hi, i'm tryna lengthen my header color to fill up the left and right side of the page and not leave any gaps...what property in css do i need to add to execute this?, and how many pixels do you suggest?
my CSS code:
header { background: black; border-color: darkorange; margin: 0 0px;
}
3 Answers
Ethan Rivas
9,979 PointsTry giving to your html and body tags a margin: 0 auto;, then you can give to the other divs a margin so they will have the little white space (margins).
Ethan Rivas
9,979 PointsI made this quick example in jsfiddle hope it helps :) : https://jsfiddle.net/Sr_Decode/k04r1hxh/
Dewayne Thomas
Courses Plus Student 10,283 Pointslink didn't work.
Ethan Rivas
9,979 PointsSorry Dwayne Thomas, that's my fault haha, I've just updated my old jsfiddle name and the link just died, here's the new one: https://jsfiddle.net/rivasethan/k04r1hxh/
Dewayne Thomas
Courses Plus Student 10,283 PointsThanks Ethan.
Dewayne Thomas
Courses Plus Student 10,283 PointsDewayne Thomas
Courses Plus Student 10,283 Pointscould you write a code example?