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.

APIs

Why did we use <li class="grid-25 tablet-grid-50">. There's no this class name in index.html. ?

AJAX

2 Answers

Steven Parker
Steven Parker
215,954 Points

These classes are both defined in css/main.css.

You're right, they aren't used in index.html, which only means they aren't in the document to start with.

But when the JavaScript code in the displayPhotos function runs, it will create new HTML that will be added to the document in the <div> element that has the id of photos. Those classes will then be targeted by the CSS rules to give them the desired styling.

Thank you Steven .