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 trialEzekiel dela Peña
6,231 PointsQuestion 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
Mark VonGyer
21,239 PointsYes!.
You can use the same ID across multiple pages, but only once per each page.
Rafael Valera
8,401 PointsRafael Valera
8,401 PointsBut what if you want to be specific when applying different CSS rules to the index.html or about.html page in the CSS file???
Mark VonGyer
21,239 PointsMark VonGyer
21,239 PointsUse a different ID and use a class for the common CSS rules.
Ezekiel dela Peña
6,231 PointsEzekiel dela Peña
6,231 PointsThen you'll need to give it another ID for that.