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 Use ID Selectors

Devin Scheu
Devin Scheu
66,191 Points

My div id is not working,

Okay so I declared my div tag and gave it the id "wrapper" but when I try to change the div's property's in my main.css It does not apply my changes.

The following have not worked: -Refreshing the page

  • Saving the program -Restarting work shop

So here is my code:

```<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title> TheBlueStormGaming | Video Maker</title>

<link rel="stylesheet" href="css/normalize.css">

<link rel="stylesheet" href="css/main.css">

</head>

<body>

<header>

  <a href="index.html">

    <h1>TheBlueStormGaming</h1>

    <h2>Video Maker</h2>

  </a>

  <nav>

    <ul>

      <li><a href="index.html">Funny Pics</a></li>

      <li><a href="about.html">About</a></li>

      <li><a href="contact.html">Contact</a></li>

    </ul>

  </nav>

</header>

<div id="wrapper">

  <section>

    <ul>

      <li>

        <a href="Img/maxresdefault.jpg">

          <img src="Img/maxresdefault.jpg" alt="">

          <p>Picture of my favorite god on smite.</p>

        </a>

      </li>

      <li>

        <a href="Img/World Of Tanks.jpg">

          <img src="Img/World Of Tanks.jpg" alt="">

          <p>This is a picture of a real tank off of WoT.</p>

        </a>

      </li>

      <li>

        <a href="Img/TheKid.jpg">

          <img src="Img/TheKid.jpg" alt="">

          <p>A close up of the main character on I Want To Be The Guy.</p>

        </a>

      </li>

       <li>

\ <a href="Img/issac.jpg">

          <img src="Img/issac.jpg" alt="">

          <p>All the characters in Binding of Isaac</p>

        </a>

      </li>

       <li>

        <a href="Img/medic.jpg">

          <img src="Img/medic.jpg" alt="">

          <p>Funny picture of a how I feel when i'm a medic in TF2</p>

        </a>

      </li>

    </ul>

  </section>

  <footer>

    <a href="http://twitter.com/devinscheu"> <Img src="Img/twitter-wrap.png" alt="twitter logo"> </a>

    <a href="http://facebook.com/devinscheu"> <Img src="Img/facebook-wrap.png" alt="facebook logo"> </a>

    <p>&copy; 2014 TheBlueStormGaming.</p>

  </footer>

</div>

</body>

</html>```

And this is the code in main.css:

a {

text-decoration: none;

}

wrapper {

max-width: 940px;

margin: 0 auto;

}

make sure your code is properly formatted as per the Markdown Cheatsheet specifications (three back-ticks before and after code.), so we can see your code properly, also make sure the indentations are good enough to make it readable.

4 Answers

Austin Davis
Austin Davis
23,939 Points

By fixed it- do you mean the problem is solved? Was the "#" character missing before the div id in the css?

Devin Scheu
Devin Scheu
66,191 Points

Thank you, I have reformatted.

Devin Scheu
Devin Scheu
66,191 Points

Never mind, I fixed it.

Devin Scheu
Devin Scheu
66,191 Points

I fixed the issue. Thank you for clarifying though.

kerry bennett
kerry bennett
1,976 Points

what was your issue with the div? I'm having a similar issue trying to target a photo. won't resize photo. As soon as i use the image tag it works immediately. No good if i have three images on a page.