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

How to make things align in a footer

I can't get my social media buttons to align left or right on the footer of my website. I'm not sure what I'm doing wrong, can anyone please help?

I have tried margin-left, margin-right, float: left, float: right

This is what I have and all it does is center.

HTML <footer class="container-fluid text-center"> <div class="row" id="contact"> <p class="col-sm-4"></p> <h1>Reach me here</h1><br><br> <a href="https://twitter.com/Aarons_coding" target="_blank"> <img src="images/twitter.png" alt="twitter" id="twitt"><br/> Follower me </a> <a href='https://www.facebook.com/freelancecoding/posts/1534409766779543' target="_blank"> <img src="images/fb.png" alt="fb" id="fb"><br/>Like Me on FB </a> <a href='https://www.linkedin.com/in/aaron-s-706193125' target="_blank"> <img src="images/link.png" alt="linkedin" id="link"><br/>Connect with me </a>

        </div>
        <ul>
            <li><a href="#top">Top</a></li>
            <li><a href="#design">About the Designer</a></li>
        </ul>
        <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d401398.0917589909!2d-85.9569564028764!3d38.18847214627973!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x88690b1ab35bd511%3A0xd4d3b4282071fd32!2sLouisville%2C+KY!5e0!3m2!1sen!2sus!4v1470171263135" 
                width="350" height="250" frameborder="0" style="border:0" allowfullscreen ></iframe>
                <div style="clear: both"></div>
    </footer>

CSS /************************************* FACEBOOK / TWITTER / LINKEDIN *************************************/

twitt{

width: 95px;
height: 95px;
margin: 5px 5px 0 18px;

}

fb{

width: 95px;
height: 95px;
margin: 5px  0 5px;

}

link{

width: 95px;
height: 95px;
margin: 5px 5px 0 5px;

}

/************************** FOOTER **************************/ footer { background-color: rgba(0,0,0,1); font-size: 12px; padding: 20px 0; text-align: center; }

footer .col-sm-4{ display: flex; justify-content: flex-end; }

footer ul { float: right; text-align: right; list-style: none; }

footer li img { width: 32px; height: 32px; }

1 Answer

Eugene Apanasenko
Eugene Apanasenko
333 Points

maybe you should try this attribute - display: inline-block; and then float left or right