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

CSS

jose macedo
jose macedo
6,041 Points

why 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
Steven Parker
230,274 Points

The container divs 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?

jose macedo
jose macedo
6,041 Points

i fixed it but also doyou know why my header background not showing

Steven Parker
Steven Parker
230,274 Points

I see the background image when I fork your workspace and preview it. Not sure why you wouldn't!

Leandro Severino
Leandro Severino
12,674 Points

Try this:

******HTML***********

<body> <div class = "container"> <h1> 90% Container </h1> </div> </body>

*******CSS*************

.container { background: green;
width: 90%; margin-left: auto; margin-right: auto; }

http://codepen.io/IamPuyih/pen/JKrgBZ

Steven Parker
Steven Parker
230,274 Points

:mailbox_with_mail: 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
jose macedo
6,041 Points

sorry itought i added it but i justed added it take a look

Steven Parker
Steven Parker
230,274 Points

Now 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
jose macedo
6,041 Points

haha ohh sorry it was the wrong one i just updated it again

jose macedo
jose macedo
6,041 Points

i expected my letters to have some space to the left

Leandro Severino
Leandro Severino
12,674 Points

I shared with you a simple example with a link, you could've checked that.