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

responsive shop item using css flex and media queries.

Derek Waltonā€¢ 20

@Derek-Walton

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?

using more semantic html

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

actual phone view being distorted, fixed by using a flex grow.

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

any improvements would be appreciated

Community feedback

Erratic Enigmaā€¢ 200

@erratic-enigma

Posted

Nice work on this challenge! There's a few improvements I can suggest:

You might be interested in reading this article that covers how to plan this challenge's HTML. There are improvements from the article I feel you could implement.

Try to favour using classes consistently in both your markup and CSS. For example, giving classes to your h2 and button elements and selecting those classes in your CSS.

You are given two images of the product to display depending on the viewport size, but your solution only uses one of them in an img element. You should use a picture element to achieve this (the aforementioned article discusses how to use this element if you're unsure).

Happy coding!

Marked as helpful

1
Daniel šŸ›øā€¢ 44,210

@danielmrz-dev

Posted

Hello @Derek-Walton!

Your project looks great!

I have a suggestion about your code that might interest you:

šŸ“Œ You can use the <picture> tag when you have different versions of the same image.

Using the <picture> tag will help load the correct image to the user's device, saving bandwidth and improving performance.

Example:

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

I hope this helps!

Other than that, excellent work!

Marked as helpful

1
P
Lo-Deckā€¢ 2,220

@Lo-Deck

Posted

Hi well done for this challenge.

You can't put <h3> or <p> in <span>

<span class="prices">
  <h3>$149.99</h3>
  <p>$169.99</p>
</span>

You can check out your html with 3WC validator.3wc.

And if you want to set different images you can use <picture>

<picture>
<source media="(max-width: 799px)" srcset="your path" >
<source media="(min-width: 800px)" srcset="your path" >
<img src="your path" alt="your description" >
</picture>

Here a link mozilla.

Marked as helpful

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