Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website CSS: Cascading Style Sheets Center the Wrapper

seem to be having problem with my wrapper.. does anyone know what I missed? thanks!

css.main

a {
text-decoration: none;
}

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

index.html

<!DOCTYPE html>
  <html>
    <head>
      <meta charset ="utf-8">
      <title>bryce Cram | Designer </title>
      <link rel ="stylesheet" href ="css/normalize.css">
      <link rel ="stylesheet" href ="css/main.css">

    </head>
    <body>
      <header>
        <a href="index.html">
          <h1>Bryce Cram</h1>
          <h2>Designer</h2>
        </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>
        <div id="wrapper">
          <section>
          <ul>
              <li>
                <a href ="img/numbers-01.jpg">
                  <img src="img/numbers-01.jpg" alt ="">
                  <p>experimentation with color and textrure</p>
                </a>
              </li>
            <li>
                <a href ="img/numbers-02.jpg">
                  <img src="img/numbers-02.jpg" alt ="">
                  <p>playing with blending in photoshop</p>
                </a>
              </li>
            <li>
                <a href ="img/numbers-06.jpg">
                  <img src="img/numbers-06.jpg" alt ="">
                  <p>trying to create an 80s style of glows</p>
                </a>
              </li>
            <li>
                <a href ="img/numbers-09.jpg">
                  <img src="img/numbers-09.jpg" alt ="">
                  <p>drips created using photoshop brushes</p>
                </a>
              </li>
            <li>
                <a href ="img/numbers-12.jpg">
                  <img src="img/numbers-12.jpg" alt ="">
                  <p>creating shapes using repetition</p>
                </a>
              </li>
            </ul>
          </section>
          <footer>
            <a href="http://twitter.com/nickrp"><img src="img/twitter-wrap.png" alt="twitter logo"></a>
            <a href="http://facebook.com/nickpettit"><img src="img/facebook-wrap.png" alt="facebook logo"></a>
            <p>&copy; 2014 Bryce Cram </p>
          </footer>
        </div>

    </body>

    </html>

10 Answers

Sreng Hong
Sreng Hong
15,083 Points

Your code is exactly the same as the course. I also downloaded project and test it for you. The small error you have is you got a space at the value of max-width

max-width: 940 px;

It should be 940px without space. Hope this helps.

I was experiencing the same problem but my issue was that i was not saving on BOTH the index file and the main.css file. Try saving both files and then refreshing the page.

Sreng Hong
Sreng Hong
15,083 Points

I don't see any problems at all. What's wrong?

Doesnt center. Have saved and refreshed. Am using chrome.

Tried using different pixel values as well, thought maybe the resolution? but the wrapper seems to do nothing at all..

Also tried a different browser. And removing the wrapper completely. Doesnt affect the page at all. )-:

Well for anyone stumbling on this one.. there cannot be a space between the value assigned the pixels.. (-:

haha great minds think alike. Thanks! (-:

I'm having the same issue, my code matches the exact code shown above, also have no space between 940 and px.

Andrea Cabral
Andrea Cabral
Courses Plus Student 10,819 Points

same here...did you figure it out ?

I am using Safari 8.0..

I'm having the same issue!

I changed the div id "wrapper" to "work"... and it worked!! lol. Hope this helps