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

Caspar Claessen
Caspar Claessen
9,060 Points

center content in footer

Dear fellow students,

I have the following question: Currently I am trying to build my own first website, but I cannot seem to get the footer content centered. Here is my code for my footer. What's the CSS I should use?

<footer class="main-footer">

    <a href="https://www.facebook.com/Awearness-1883816761894408/?ref=aymt_homepage_panel">
      <img src="C:\Users\User\Documents\Awearness-img\fblogoawearness.jpg" alt="" class="social-icon">
    </a>
    <a href="https://www.instagram.com/awearness.nu/">
      <img src="C:\Users\User\Documents\Awearness-img\instalogoawearness.jpg" alt="" class="social-icon">
    </a>
    <span>&copy;Awearness</span>

</footer>

Also I sometimes get strange low indents in between my social icons.

Looking forward to a reply!

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi Caspar,

You need to select the footer element with CSS and use the property that aligns text content of an element. Remember with CSS text content refers to any content that lives inside a containing element. Remember to give your element a fluid width that matches the rest of your styles :)

Caspar Claessen
Caspar Claessen
9,060 Points

Thanks for the answer Jonathan! But I still have the following problem. When I use the align context element, I get the following (X is content, in this case an image).

X_X_

There appear low indent marks. Why is this? Looking forward to your answer.