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

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

Logan Bayless
Logan Bayless
1,097 Points

<div> in css won't change page

When using the css file, I can get it to alter the anchor elements but not the <div> section. Here is my css code:

a {
    text-decoration:none;
}
#wrapper {
    max-width: 940px;
    margin: 0 auto;
    background: orange;
}

Following is the code in my html worksheet:

     <div id:"wrapper">
        <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>
        <li>
          <a href="img/numbers-02.jpg">
                        <img src="img/numbers-02.jpg" alt="">
                        <p>Playing with blending.</p>
                    </a>
                </li>
                <li>
                    <a href="img/numbers-06.jpg">
                        <img src="img/numbers-06.jpg" alt="">
                        <p>Write image description here.</p>
                    </a>
                </li>
                <li>
                    <a href="img/numbers-09.jpg">
                        <img src="img/numbers-09.jpg" alt="">
                        <p>Write image description here.</p>
                    </a>
                </li>
                <li>
                    <a href="img/numbers-12.jpg">
                        <img src="img/numbers-12.jpg" alt="">
                        <p>Write image description here.</p>
                    </a>
                </li>
            </ul>
        </section>      
        <footer>
            <a href="http://www.twitter.com"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a>
            <a href="http://www.facebook.com"><img src="img/facebook-wrap.png" alt="Facebook Logo"></a>
            <p>&copy; 2015 Logan Bayless.</p>
        </footer>
      </div>
Logan Bayless
Logan Bayless
1,097 Points

As other people have mentioned, for some reason the # wasn't included when I copied and pasted, but my code does have a # before wrapper on my css sheet.

2 Answers

In your html, you have

<div id:"wrapper"></div>

this should be

<div id="wrapper"></div>
Logan Bayless
Logan Bayless
1,097 Points

Hi Wesley. Whatever you typed after "have" and after "be" didn't display on my browser.

Kevin Korte
Kevin Korte
28,149 Points

I fixed the formatting for him Logan, so take a look again. And I agree with Wesley, your html is not quite right if you have the : in there.

there we go.... not used to Markdown

Logan Bayless
Logan Bayless
1,097 Points

Thanks for helping Kevin!