Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

brandonlind2
brandonlind2
7,823 Points

Why is text-align center used to center a footer?

Why is text-align: center used to center a footer when a footer isnt text, but a block element? logically shouldn't (text-align) align well, text. If I look up the text align it says its used to center texts, so I'm a bit confused.

2 Answers

Bryce Santos
Bryce Santos
11,144 Points

You're positioning what's in the footer, which consists of text usually. So if you have, let's say a "p" tag inside the footer, you'd be using the text-align on the p tag within the footer.

brandonlind2
brandonlind2
7,823 Points

What if its a facebook icon?

Bryce Santos
Bryce Santos
11,144 Points

Yep, you'd still use text-align. Think of it as microsoft word, and it's just justifying left, center, and right. This includes text and images.