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

Product preview card component

Anna 545

@NitaLewska

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Ahhh, finally, thanks to this challenge, I've got it how to use <picture> tag! =) I had some tough time adjusting line-height and letter-spacing properties, I hope it looks close enough to the design =)

As, supposedly, it's a product card for some store, it doesn't have any <h...> tag, and the index.html doesn't have header/main/footer structure. I've made it on purpose, it's not a mistake =)

Also, I've tried to use BEM methodology, please, check it out, any advice is welcome!

Community feedback

@VCarames

Posted

Hey there! 👋 Here are some suggestions to help improve your code:

  • You only need one source in inside your picture element. The only reason you would need more than one sources is because you have a light/dark theme or your are using different image formats and want to have a fallback.

  • Remove the <br> elements you added; they are unnecessary. You will create the line breaks using padding.

  • Currently, the old price (169.99) 🏷 is not being properly announced to screen readers. To fix this, you are going to wrap the the price in a Del Element and inside it you will add a Span Element with an sr-only class that will state something like “The previous price was…” and use CSS to make it only visible to screen readers.

  • Implement a Mobile First approach 📱 > 🖥

With mobile devices being the predominant way that people view websites/content. It is more crucial than ever to ensure that your website/content looks presentable on all mobile devices. To achieve this, you start building your website/content for smaller screen first and then adjust your content for larger screens.

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding! 🍂🦃

Marked as helpful

1

Anna 545

@NitaLewska

Posted

@vcarames That's cool that you've given so many pieces of advice except of the one i've asked about =)

0

@VCarames

Posted

@NitaLewska

Whats the question? I did not see one in the question section...

(If its about the "BEM Methodology"... I don't use it. So I would be of no help.)

0
Anna 545

@NitaLewska

Posted

@vcarames yeah =) BEM is really popular here in Russia, so I want to learn how to use it properly

  1. I'll correct source - i've taken this piece of code from some example, thanks to you, I've read how to use it properly, thanks =)
  2. del? =) this is first time me hearing about this, I'll definitely check it out, and the whole idea about invisible spans for screen-readers. Do you know any good vids/courses on ARIA and assesibility?
0

@VCarames

Posted

@NitaLewska

That's pretty interesting. I had no idea BEM was that popular. I seen some users use it here, but most create their own naming convention.

Here are some articles regarding BEM:

https://en.bem.info/methodology/quick-start/

https://css-tricks.com/bem-101/

https://www.devbridge.com/articles/implementing-clean-css-bem-method/

When it comes to accessibility, each country has their own standards. But for multinational companies is crucial to ensure access to everyone.

Here are some articles regarding website accessibility:

https://www.accessibilitychecker.org

https://webaim.org/techniques/css/invisiblecontent/

https://www.w3.org/WAI/fundamentals/accessibility-intro/#examples

https://www.w3.org/TR/WCAG20-TECHS/ARIA11.html

Marked as helpful

1
Anna 545

@NitaLewska

Posted

@vcarames thanks a lot!

1

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