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 How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

Why did you apply the "font-size: 2.5em;" on the h1 tag instead of the #logo ID that you were already working on?

Why did you apply the "font-size: 2.5em;" on the h1 tag instead of the #logo ID that you were already working on?

I wanna know if there is a reason why? because i fell like both the h1 and the logo #ID are style the same information..

1 Answer

Greg Kaleka
Greg Kaleka
39,019 Points

Hi Omar,

The key here is that #logo rules will only target that particular element, whereas h1 rules will target all h1 elements. The advantage of targeting h1 is that later on the page (or even on other pages!), your h1 elements will all be that size. It's what makes CSS so powerful - you can describe what you want hundreds of pages on your site look like.

Let me know if that answers your question.

Best,

-Greg

Yes it does answer my question. and it makes sense. I guess I was confused because i didn't see the h1 element being used anywhere in the website so far. but I guess it makes sense in case we were to add it later. thank you!!!!!!!!!!!!!

Greg Kaleka
Greg Kaleka
39,019 Points

No problem! Glad it makes sense :)