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
jose macedo
6,041 Pointswhy is my class not working
why does my container class's width not setting to 90%? here is my code https://w.trhou.se/tmiz0xyhwq
4 Answers

Steven Parker
224,872 PointsThe container div
s ARE being set to 90% width. Try adding a border to the container class so you can see it:
border: 1px solid red;
But without the border, the width change is not really visible except on a very narrow window. What did you expect to see?

Leandro Severino
12,674 PointsTry this:
******HTML***********
<body> <div class = "container"> <h1> 90% Container </h1> </div> </body>
*******CSS*************
.container {
background: green;
width: 90%;
margin-left: auto;
margin-right: auto;
}

Steven Parker
224,872 Points I got your message, but you'll need to post your code, along with a link to the video or challenge you are working with to make it possible to help you.

jose macedo
6,041 Pointssorry itought i added it but i justed added it take a look

Steven Parker
224,872 PointsNow I see your snapshot, but I'm not able to find anything with a class container, nor do I see any CSS rules setting anything to 90%.

jose macedo
6,041 Pointshaha ohh sorry it was the wrong one i just updated it again

jose macedo
6,041 Pointsi expected my letters to have some space to the left

Leandro Severino
12,674 PointsI shared with you a simple example with a link, you could've checked that.
jose macedo
6,041 Pointsjose macedo
6,041 Pointsi fixed it but also doyou know why my header background not showing
Steven Parker
224,872 PointsSteven Parker
224,872 PointsI see the background image when I fork your workspace and preview it. Not sure why you wouldn't!