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 trialYashar Soroosh
5,617 Pointsdiv
Hi I applied the div on the index file and all the css code on css main file however my images do not get centred. Nothing really changes. What could I be doing wrong?
12 Answers
Rose Hurst
5,658 PointsHi Yashar, Have you double checked the that your syntax is correct in your main.css? Things to look for are missing Curly braces { }, and ; <br>
Another thing to look at is if you used "class" or "id" in your div.
Eric Flowers
9,472 PointsHi Yashar, have you linked your stylesheet? If so double check the syntax.
<head>
<link rel="stylesheet" type="text/css" href="mainstyles.css"
</head>
Yashar Soroosh
5,617 PointsI have but I followed the way shown on the video.html<head> <link rel ="stylesheet" href = "css/main.css"></head>
Yashar Soroosh
5,617 Points"<head> <link rel ="stylesheet" href = "css/main.css"></head>"
Yashar Soroosh
5,617 PointsEric I don't know why but it does not display my code when I try to type it in the text box
Yashar Soroosh
5,617 PointsEric I don't know why but it does not display my code when I try to type it in the text box
Yashar Soroosh
5,617 PointsEric I don't know why but it does not display my code when I try to type it in the text box
Yashar Soroosh
5,617 Pointsa { text-decoration: none; }
wrapper {
max-width: 940px margin: 0 auto; background: orange; }
It seems correct
Eric Flowers
9,472 PointsIf you copied that from your text editor Rose nailed it. You're missing a semicolon after max-width.
Yashar Soroosh
5,617 PointsThanks guys it worked. I appreciate your help.
Jan Kana
1,106 PointsHi, Yashar, if you have only <div> you must add class in your html document, so it should be <div class="wrapper">your code</div> and in css document you need to edit wrapper to .wrapper
EDIT:// I'm sorry, I didn't see your response, that it has been resolved
Yashar Soroosh
5,617 PointsThanks Jan