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

Quotations Causing <div> to not work properly?

Firstly, I'm using Notepad++, as it could just be something with that. I was having problems centering my #wrapper in my main.css file, and narrowed it down to being the <div> in my index.html. I found out the reason it wasn't working was because of the "" around it. Once I removed the quotes it worked fine. Why is that? Am I doing something wrong? I have other attributes, names, etc in my index.html file with quotes and have had no issues until now.

1 Answer

Hey Nick,

Can you post your code?

<div id=wrapper>
    <section>
    </section>
    <footer>
    </footer>
</div>

And my css:

#wrapper {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 5%;

Whenever I put quotes around "wrapper" in my <div>, it doesn't apply. However when I remove them, it does. I feel like this is simply my program now though. Thanks!