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 solution

#accessibility
Yessika 10

@yessikaplata

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Elaine 11,420

@elaineleung

Posted

Hi Yessika, congrats on completing your first Frontend Mentor challenge! 😊

You did an excellent job here with this card as your first FEM project, and I think the use of a media query here is a good start. How we normally pick a media query really depends on what we want the user to see. For example, you chose 375px as the point where the component changes into the desktop view with the two columns; see if you can have a look at what happens at around 380px to 395px in the inspector in your browser with the responsive mode on.

For me, I see that there are two columns, and the perfume bottle is half hidden. Normally, that might not be what we want the user to see. What I might do is to choose a breakpoint when I think the view is optimal, as in, everything looks good, nothing looks squished or out of place, and for me, it looks like 550px works here with your code. Before that point, I might not want the mobile view to have a width of 550px; I would prefer to have some space around the card, and so I would set a max-width on your .card-grid of somewhere between 400px to 450px. It takes a lot of experimentation, so just keep trying, and you'll start to get a feel of what looks good and what doesn't 🙂

Just a few more points to make:

  1. One suggestion I have is to start your design with a mobile first approach, meaning that you start writing the code for the mobile view and then use a media query for the desktop view.

  2. Your mobile image is actually not showing up at all; that's because your media query for the image is placed before the desktop image, and so due to the nature of CSS, the desktop image will always be used. All you need to do is place the media query at the end. You can also try using the picture element for the image instead, especially images that relate to content because that would be better for accessibility. The picture element allows you to put more than one image inside, and you can use a media query to tell the browser which image to choose. That way, you won't have to write a media query for the images!

  3. In the mobile view, the height of the image and the text are the same, but in the design, the image is shorter than the text area. This is because you used a 1fr 1fr for the grid rows. For the column view, I actually suggest you use flexbox instead of grid, but in case you're more comfortable with grid, then I would say try a different proportion, such as 1fr 1.5fr.

Hope this helps you out, and you're doing great, so keep going!

0
Adarsh Rai 560

@AdarshRai0

Posted

Great you Had Solved Your Issuse .. **Now for More Challenging ** Try Making your solution as the design;🎯✅

0
Adarsh Rai 560

@AdarshRai0

Posted

Hi Yessika, congratulations on your new challenge! You had done a great job !!! I took a look at your code and I have some tips for you. To avoid the HTML Issues Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections.

Document should have one main landmark

Context: <html lang="en">

All page content should be contained by landmarks div to Footer

Context:

<div class="attribution">
    Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. 
    Coded by <a href="#">Daniel Daporta</a>.
  </div>

To

<footer class="attribution">
    Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. 
    Coded by <a href="#">Daniel Daporta</a>.
  </footer>
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