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 CSS Basics (2014) Basic Selectors CSS Comments

Question about IDs.

I understand that I can use only one ID per page. But can I use ID from another page?

ex: I use ID = "div-wrapper" from index.html Then I use the ID ="div-wrapper" again from about.html

1 Answer

Yes!.

You can use the same ID across multiple pages, but only once per each page.

But what if you want to be specific when applying different CSS rules to the index.html or about.html page in the CSS file???

Use a different ID and use a class for the common CSS rules.

Then you'll need to give it another ID for that.