Design comparison
Solution retrospective
Others are using classes instead of id's, which should I use in this challenge?
Community feedback
- @12KentosPosted over 2 years ago
@Tommaso6468 You can use either classes or id's however classes are generally favored more, as they can be applied to multiple elements while an id can only be applied to one element. Another thing to keep in mind is that id's have a higher specificity than classes.
Here are some good explanations of when to use a class or id.
Hope that helps!
Marked as helpful1 - @Hanka8Posted over 2 years ago
Hi Tomasso, nice job!
The main difference between ids and classes is that id can be used only on one element, while classes can be use for one ore more elements. The second thing is that ids are more specific, so they take precedence in your css. Generally classes are more common, because you can reuse them on other elements in greater projects.
Other suggestions:
• you should prefer semantic elements against non-semantic, so use <main> instead of <div>;
• the document should have at least one <h1> landmark, so use <h1> on the heading instead of <p>;
• the shadow around the card appears to be a little bit lighter than your solution, also the heading has a greater "font-weight"
Keep up the good work!
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord