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 trialJason Chiu
4,373 PointsHelp me understand why Randy use specific classes to create details page for each shirt?
In the html section of shirt php Randy uses " breadcrumb", "Shirt picture", "shirt details", and "note designer" as the name of classes. I tried to use a different names for these to see if the names can have some flexibility but they did not work.
So the thing that confuses me is why Randy uses these names for the classes? Why are the names so specific? Thanks.
1 Answer
Joe Cochran
18,249 PointsClasses are used in this video to apply css styling to elements on the page. Randy has already set up all the CSS for the project, so that you can focus on the PHP development. "shirt-picture," "breadcrumb," all had their styling set up in the css file that comes with the project. If you change one of those classes, the pre-written css will no longer apply to the element in question, and the styling will go away.
If you need some help understanding the role of CSS in web development, the CSS Basics course has all the information you need. For a short article on the topic, here's the MDN entry called What is CSS?