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 trialMatt McNally
516 PointsMobile Website Complete, No Margin or Padding on Left Side Only When Browser Made Small
When I see Nick look at his website, which I believe my code to be almost identical to besides adding my own pictures and such, there is either a margin or padding for the text and images on both the left and right when the browser is shrunk to a mobile size.
After getting this far, the only difference I have noticed is that my text and images are riding up against the left of the screen with no apparent margin or padding taking effect there.
I am new to CSS but after reviewing my code I can't figure out why this is the case. Could anyone offer any help?
Matt McNally
516 PointsHTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Matt McNally | Photographer</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='http://fonts.googleapis.com/css?family=Oswald:400,700|Open+Sans:400italic,700italic,700,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/responsive.css">
</head>
<body>
<header>
<a href="index.html" id="logo">
<h1>Matt McNally</h1>
<h2>Photographer</h2>
</a>
<nav>
<ul>
<li><a href="index.html" class="selected">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 id="gallery">
<li>
<a href="img/Newport_Seagull.JPG">
<img src="img/Newport_Seagull.JPG" alt "">
<p>Seagull. Newport, OR.</p>
</a>
</li>
<li>
<a href="img/RedwoodTrailSwamp.JPG">
<img src="img/RedwoodTrailSwamp.JPG" alt "">
<p>Swamp in the Redwood Forest, California.</p>
</a>
</li>
<li>
<a href="img/SadLucy.JPG">
<img src="img/SadLucy.JPG" alt "">
<p>My Sad Dog, Lucy.</p>
</a>
</li>
<li>
<a href="img/Dodgeball.JPG">
<img src="img/Dodgeball.JPG" alt "">
<p>Dodgeball at Colonel Summers Park in Portland, OR.</p>
</a>
</li>
<li>
<a href="img/Caterpillar.JPG">
<img src="img/Caterpillar.JPG" alt "">
<p>Caterpillar Close Up</p>
</a>
</li>
</ul>
</section>
<footer>
<a href="http://twitter.com/pdxpigeon"><img src="img/twitter-wrap.png" alt "Twitter Logo" class="social-icon"></a>
<a href="http://facebook.com/"><img src="img/facebook-wrap.png" alt "Facebook Logo" class="social-icon"></a>
<p>© 2015 Matt McNally.</p>
</footer>
</div>
</body>
</html>
2 Answers
Richard Nicholls
1,301 PointsThe only thing different on my project is some padding on the wrapper
wrapper {
max-width: 940px; margin: 0 auto; padding: 0 5%; }
Try that if not post the responsive stylesheet so we can look at that
Matt McNally
516 PointsThat was it! Thanks for the help!
Melissa Wheeler
6,306 Pointsin you html, in your img tag you alt is wrong should be
<img src="img/Newport_Seagull.JPG" alt="">
not
<img src="img/Newport_Seagull.JPG" alt "">
you'll notice the quotes after alt are orange. you need the equal sign after alt and before your quotes.
Matt McNally
516 PointsThanks.
Matt McNally
516 PointsMatt McNally
516 PointsCSS