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

My css styling isnt showing. Is there something wrong with my code?

my index.html code

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Reginald Williams| User Experience </title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>

my main.css

body { background:green; text-decoration:none; }

wrapper {

max-width:940;
margin: 0 auto;
padding: 0 5%;
background: orange;

}

max-width: 940;

I think you meant for that to be:

max-width: 940px;

Thank you! i changed it but i still cant get the color or any other format changes to show up

Is this for a challenge or just a personal thing?

Do you have wrapper as a class? In your css it would need to have the period in front of it:

.wrapper

its for a challenge and I have wrapper as an ID

As an ID it has to have the Octothorpe in front of it in CSS

#wrapper{
    max-width: 940px;
    margin: 0 auto;
    padding: 0 5%;
    background: orange;
}

I used the octothorpe just forgot to copy and paste it but my problem is that none of the formatting is being displayed not only the wrapper id.

8 Answers

I know someone else already answered in a comment, but in the future, I'd suggest using this free tool to catch inconsistencies like this. I use it all the time!

http://www.css-validator.org/

Check out the w3c for html validator as well. Like what I have to say? Show your appreciation with points or with best answer mark.

this was a very helpful tool however my problem is that none of my formatting is showing as if the link to HTML and CSS isnt working

Have you used a # in front of your wrapper in the main.css?

yes and none of the body formatting is being shown either

Are you able to show us all of your HTML code?

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Reginald Williams| User Experience </title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <a href="index.html" id=logo> <h1>Reginald Williams</h1> <h2>User Experience Designer</h2> </a> <nav> <ul> <li><a href="index.html">about</a></li> <li><a href="about.html">other</a></li> <li><a href="page.html">pagr</a></li> </ul> </nav> </header> <div id="wrapper"> <section> <ul> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt="picture of something"> <p>ifk</p> </a> </li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt="picture of something"> <p>playing with photoshop</p> </a> </li> <li> <a href="img/numbers-06.jpg"> <img src="img/numbers-06.jpg" alt="picture of something"> <p>ifk</p> </a> </li> <li> <a href="img/numbers-09jpg"> <img src="img/numbers-09.jpg" alt="picture of something"> <p>ifk</p> </a> </li> <li> <a href="img/numbers-12.jpg"> <img src="img/numbers-12.jpg" alt="picture of something"> <p>ifk</p> </a> </li> </ul> <p>About will go here </p> </section> <footer> <a href="http://twitter.com/reginaldmw"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a> <a href="www.linkedin.com/in/regwill909"><img src="img/linkedin-icon-small.png" alt="Linkedin Logo"></a> <p>Ā© 2014 Reginald Williams.</p> </footer> </div> </body> <html>

That closing anchor tag under user experience designer may be an issue, where was it opened? I don't see an opening anchor tag for it.

i know this is a simple one but check your main.css is in a css folder and not in the same folder as your HTML

James Head - That is where I was going next, usually a file/folder file-path issue.

have you used the html, head and body tags they arnt in the HTML code above?

So are you using a body selector or an ID or Class? Remember, periods have classes and ID's will pound you.

. = class

= id

Check those. Make sure your file path is correct. max-width:940 should be max-width: 940px;reserved

The background selector should be a hex color, not a reserved word. I know there are some fun ones, but there are just millions more colors than reserved words. And try adding in a space between the wrapper and the { brace, so:

wrapper {

max-width: 940px;
margin: 0 auto;
padding: 0 5%;
background: #EE7600;

}

And again, use my validators for html and css. they will help. http://validator.w3.org/

http://www.css-validator.org/

http://www.htmlhelp.com/tools/validator/

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Reginald Williams| User Experience </title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <a href="index.html" id=logo> <h1>Reginald Williams</h1> <h2>User Experience Designer</h2> </a> <nav> <ul> <li><a href="index.html">about</a></li> <li><a href="about.html">other</a></li> <li><a href="page.html">pagr</a></li> </ul> </nav> </header> <div id="wrapper"> <section> <ul> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt="picture of something"> <p>ifk</p> </a> </li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt="picture of something"> <p>playing with photoshop</p> </a> </li> <li> <a href="img/numbers-06.jpg"> <img src="img/numbers-06.jpg" alt="picture of something"> <p>ifk</p> </a> </li> <li> <a href="img/numbers-09jpg"> <img src="img/numbers-09.jpg" alt="picture of something"> <p>ifk</p> </a> </li> <li> <a href="img/numbers-12.jpg"> <img src="img/numbers-12.jpg" alt="picture of something"> <p>ifk</p> </a> </li> </ul> <p>About will go here </p> </section> <footer> <a href="http://twitter.com/reginaldmw"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a> <a href="www.linkedin.com/in/regwill909"><img src="img/linkedin-icon-small.png" alt="Linkedin Logo"></a> <p>Ā© 2014 Reginald Williams.</p> </footer> </div> </body> <html>

i used the header and body tags not sure why they aren't copying when I copy and paste

Double check where your CSS files are located. The way you have it set up:

main.css and normalize.css should both be contained inside a folder called css.

Hi Reginald,

Do you use dropbox? If you do, drop your files in there share the link and ill take a closer look and see if I can work out why it isn't working for you.

both files are in the css folder !