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 with sass

#sass/scss
Jarmoβ€’ 60

@Jarmovd

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


What are you most proud of, and what would you do differently next time?

Focused on mobile first and made it easier to change to desktop.

What challenges did you encounter, and how did you overcome them?

Worked with two imgs in the html. One for mobile and one for desktop and alternated between them via display none through media queries for mobile and desktop.

What specific areas of your project would you like help with?

Is there another method to change between these two imgs for mobile and desktop?

Community feedback

Chermann KINGβ€’ 350

@Chermann-KING

Posted

Hi Jarmo πŸ‘‹πŸΎπŸ˜€

First of all, congratulations πŸ‘πŸΎ on the work you've doneπŸ™‚. It's not bad at this level. Now you just have to take into account the elements provided for particular types. That's the best way to improve accessibility.

I recommend that in this type of case where the interface designer provides you with several images depending on which device the user will end up on, you use the picture tag in HTML, which potentially receives source tags and the img tag. This will simplify stylisation and is mainly designed for this type of case.

Here's the link to my solution if you want to see how I solved the challenge πŸ˜‰

Marked as helpful

1
Ibrahim Oyeniyiβ€’ 370

@Mtrxxo

Posted

Hello Jarmo, Yes, there's another way of changing the images, you can try Using the picture element like this:

"<picture>

<source media="(min-width: 768px)" srcset="{desktop image path here}">
<img src="{mobile image path here}" alt="{alternative text here}">

</picture>"

Your code looks great, Happy Coding 😊✨

Marked as helpful

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