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


Lou Costello
Lou Costello
2,232 Points

Max-Width not working or turning orange?

Hey all,

Need a second set of eyes...

I've cleared my cache, restart my computer, etc. It works when I change the background of the body to orange, but will not work for my wrapper selector.

CSS: a {text-decoration: none;}

wrapper {max-width: 940px; margin: 0 auto; background: orange;}

(there is a pound sign in front of the wrapper, but the CSS won't display properly...added 4 spaces...)

HTML (Part): <!DOCTYPE html>

<html> <head> <meta charset="utf-8"> <title>Ashley Costello | Digital Marketing, Web Design   Development</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/style.css"> </head> <body> <header> <a href="index.html"> <h1>Ashley Costello</h1> <h2>Digital Marketing, Web Design, Web Development</h2> <!--Don't forget to put linkedin button-->
</a> <nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header> <section> <ul> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li>

3 Answers

Ryan Dudley
Ryan Dudley
Treehouse Project Reviewer

What are you trying to contain within the wrapper? You have created a wrapper ID in your css, but I do not see it applied to any element in the html file. For example if we wanted the wrapper to contain the elements nested in our section element we would add an id attribute with the correct name to the section element.

For example:

  #wrapper {
    max-width: 940px;
    margin: 0 auto;
    background: orange;
<section id="wrapper">
  <h1>I am contained within the wrapper!</h1>
Seth Kroger
Seth Kroger
56,413 Points

The # sign in CSS looks for an element in the HTML with an id attribute. None of your tags has an id yet. You should add id="wrapper" to one of the tags, probably the section tag or a div tag just inside it.

Lou Costello
Lou Costello
2,232 Points

Oh wow... Thanks guys!