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
Edson Mendieta
698 PointsWrapper id not working?
Below is my HTML code.
I have attempted to use a wrapper id to center the surrounded elements but whenever I open up the webpage everything is still aligned on the left hand side. Apparently the div tag is not showing up in this pasting of my code. Imagine it being right before header and after the closing footer tag, and encapsulating all that code.
Any ideas what's wrong with this code? I have checked all the indentations and they seem to be in order.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Edson Mendieta | Stuff</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div id="wrapper">
<header>
<a href="index.html">
<h1>Edson Mendieta</h1>
<h2>Stuff</h2>
</a>
<nav>
<ul>
<li><a href="index.html">About</a></li>
<li><a href="coding.html">Coding</a></li>
<li><a href="health.html">Health</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<section>
<img src="img/Old Classroom.jpg" alt="home page image">
</section>
<footer>
<a href="https://www.facebook.com/edson.mendieta">
<img src="img/facebook.png" alt="Facebook Logo">
</a>
<a href="https://twitter.com/SpaceneedleB">
<img src="img/twitter.png" alt="Twitter Logo">
</a>
</footer>
</div>
</body>
</html>
CSS
wrapper {
max-width: 940px; margin: 0 auto; }
Rich Bagley
25,869 PointsNo problem, glad you got it sorted :)
2 Answers
Rich Bagley
25,869 PointsHi,
I can't see your full code. Can you wrap your HTML code in the post above (not your actual code) in 3 backticks (```) on the line before and 3 on the line after please? Then do the same for the CSS. In the meantime this is how it should look in theory.
HTML
<div id="wrapper">
<!-- This is my content -->
</div>
CSS
#wrapper {
/* My styles go here */
}
Hope that helps you to debug.
-Rich
Ali M Malik
33,293 PointsI don't see the wrapper div around the content, you need to make a div with the class of wrapper the hold all your content in the html.
Edson Mendieta
698 PointsEdson Mendieta
698 PointsUpdate: The content is wrapped in div tags it just isn't showing up. However, I went ahead and pasted it into notepad and everything was working fine. I think it was just workspaces acting up a little. Anyways, thanks for you replies!