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

help with icon align in css

Hello, i am wondering how i can align 2 icons next to eachother using css? i cant seem to get it right, im trying to place them in the center of my page next to eachother in a line

here is my css for the social icons

social-icon {

position: relative;
padding: 20px;
width: 125px;
height: 125px;
display: block;
margin-left: auto;
margin-right: auto;

}

Would it be possible to see the HTML as well. Then we can see what we can do :)

2 Answers

There are lots of ways to do this, but try changing your display to inline-block.

thank you i had the html part in footer instead of section, and changing it to inline-block worked :)

Glad it's sorted. You could also use inline elements like "span" to achieve the same result without the need for display property.

You will develop your own technique over time.