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

Emilio Liriano
11,090 PointsHow can I center logo with css (mobile responsive version)?
Greetings Treehouse, I just finished the "How to Make a Website" section and wanted to practice so I'm doing the site from scratch again with some custom parts. I removed h1/h2 and replaced with an image. I cant seem to get the logo centered above the nav. I have tried floating, playing with margins and padding.
direct link: http://ramonliriano.com/project1/
I'm building mobile version first like in the course. Working on the tablet/desktop versions later.
Any advise will be greatly appreciated.
Thanx :)
2 Answers

Steven Byington
13,584 PointsYou would need to set the image display to block and auto for the left and right margins.
.logo {
display: block;
margin: 0 auto;
}
Here is a great guide to help with centering: http://css-tricks.com/centering-css-complete-guide/

Emma Willmann
Treehouse Project ReviewerI changed #logo to display block and then the margins to o and auto. Worked for me. This is what I had:
#logo {
display:block;
max-width: 300px;
margin: 0 auto;
width: 90%;
}

Emilio Liriano
11,090 PointsTy Emma.
Emilio Liriano
11,090 PointsEmilio Liriano
11,090 PointsThank you, was on right track was just missing display block.