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
brandonlind2
7,823 PointsDoes margin: auto; completely center things?
I'm making a mobile version of a site and I have the images stacked on top of each other like block elements normally are. When I center them with margin auto they center with a width of 80% or lower, however if I make it 90% the image column ends up more on the left of the screen. Am I doing something wrong or is margin auto not perfect at centering things? Would I simply fix this by adding padding or is there a better way?
brandonlind2
7,823 PointsI figured it out when I went to take snapshots. The image was smaller in px width, then the list item element at bigger screen sizes. thanks anyway!
1 Answer
David Viri
11,324 PointsYou could possibly have a bigger margin on one side than the other or more padding on one side as opposed to the other. We cannot tell without your actual code.
brandonlind2
7,823 PointsI figured it out when I went to take snapshots. The image was smaller in px width, then the list item element at bigger screen sizes. thanks anyway!
rydavim
18,814 Pointsrydavim
18,814 PointsYou'll need to post your code so we can help figure out what might be causing your issue.
The easiest way to do this is to share you workspace using snapshots. You use this feature by clicking on the camera icon in the top right of your workspace and posting the resulting link here on the forums.