Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR Code component solution

@Tommaso6468

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Others are using classes instead of id's, which should I use in this challenge?

Community feedback

P

@12Kentos

Posted

@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.

stack overflow

develop intelligence

Hope that helps!

Marked as helpful

1

Hana 870

@Hanka8

Posted

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 GitHub
Discord logo

Join 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