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

HTML

ID Selector and Center the Wrapper

I seem to be adding my code properly and have used the W3C validator: it says everything is good. However, since creating and implementing main.css I am unable to see any changes in the preview of my website. The links are still underlined and the background color is not changing. I have main.css in the css folder along with normalize.css. However, index.html is not in this folder. Am I missing something? Any help would be appreciated. Thank you!

<head>
    <meta charset="utf-8">
    <title>Chelsea | Crafter</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
</head>
 </header>
    <div id="wrapper">
      <section>
</footer>
    </div>
  </body>
#wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 5%;
  background: grey;
}

2 Answers

A couple of things I would look at.

First, looking at the links to the CSS pages, you need to designate the type in the link: <link rel="stylesheet" type="text/css" href="css/normalize.css" > <link rel="stylesheet" type="text/css" href="css/main.css" >

Second, on the main.css stylesheet, there is no declaration being made for the anchor tags. If you are looking to change the properties of all the anchor tags to remove the underline and change the background color to grey the css property declaration on the main.css stylesheet would be:

a { text-decoration: none; background-color: grey; }

if the game plan is to have only the anchor tags within the wrapper remove all underlines and change the background color to grey, then the CSS property declaration would be:

wrapper a {

  text-decoration: none;
  background-color: grey;

}

Hope this helps.

Thank you for replying, James. I add the type of the link to the css link lines (which was not apart of the HTML tutorial/video) but I am still finding that any changes made in main.css are not showing up when I preview my page. I went back to W3C and they recommended the following.

<style>
      a:link {text-decoration:none;}
    </style>

but this is in the .html file and not the .css file. It will have the intended effect on the page, but I was wondering why I couldn't get the .css file to work properly. Thanks again!

--Chelsea Roush