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

I can't access my class in CSS

Hey Everyone,

I have some html>> <!--

<footer class="social">
            <a href="http://www.facebook.com"><img src="" alt="facebook logo" </a> 
                 <a href="http://www.twitter.com" alt="twitter logo"><img src="" alt"" </a> 

    </footer>

--->

And some CSS footer.social{ width:202px; height:20px; margin:0 5px; }

But the CSS won't change the html class. It's like it's not linked up. Has anyone got any ideas? Am I referencing it wrong?

Thanks Theador

3 Answers

Hector Castillo
Hector Castillo
2,620 Points

Hi Andrew,

After adjusted the img tags like Robert showed you try remover the word "footer" after ".social" in your CSS code so it reads.....

.social {width: 202px; height: 20px; margin: 0 5px;}

I believe you don't need to select the element "footer" because you gave it a class name of "social"

Hope this helps.

Hi Andrew,

Your img tags aren't closing.

<img src="" alt="facebook logo" </a>

/* needs to be */
<img src="" alt="facebook logo"></a>

/* don't forget the other image tag */

I have re-adjusted it but it still doesn't seem to work :S

      <footer class="social">
                <a href="http://www.facebook.com"><img src="http://placehold.it/50x50" alt="facebook logo"> </a> 
                     <a href="http://www.twitter.com" alt="twitter logo"><img src="http://placehold.it/50x50" alt""> </a> 
                 <p>&copy; 2014 Andy Taylor</p>
        </footer>

footer.social{ width:202px; height:20px; margin:0 5px; }

I have put the width to an extreme so I can see if it is working. I think I am referencing it wrong.

Yer footer.social worked but I can use just .social too. The thing I was missing was a * so it was .social*{}