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

CSS How to Make a Website CSS: Cascading Style Sheets Style the Basic Elements

center it on the page using the margin property.

Help me with this please..

If it is an image use:

img {
display: block;
margin: 0 auto;
}

If it is, for example, a paragraph, only use margin:

p {
margin: 0 auto;
}
Andrew McCormick
Andrew McCormick
17,730 Points

@martinfrank I noticed that you asked two questions in a row that corresponded to the first two questions in the code challenge and were answered by watching the videos leading up to the challenge. Please don't waste an opportunity to learn here at Treehouse by just trying to answer the challenges. Make sure to watch the videos that lead up the questions.

If you are watching the videos, then when you come to ask a question on the forum please post the code that you're already tired so that we can see you are making a valiant attempt. thanks.

2 Answers

Andrew McCormick
Andrew McCormick
17,730 Points

check out a couple videos back, right at the 20sec mark. link to video: center the wrapper

@andrew McCormik I know. I watched the video but i really couldn't type the code right. The first question was obvious but the second one was really hard for me :-). Did something wrong.