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 Product Page Using Flex

Elias Lind 130

@EL132

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


I was trying to focus on semantics and overall readability in my code; how is my semantics and CSS as a whole? Also, I used screenclip and saved the image as a JPEG for the image of the perfume; is this what everyone else does? Finally, I wasn't sure how to "crop" the image without changing its size (for the mobile version); can someone help me with that?

Community feedback

Adriano 34,090

@AdrianoEscarabote

Posted

Hi Elias Lind, how are you?

I really liked the result of your project, but I have some tips that I think you will enjoy:

  • every Html document must contain the main tag, so we can identify the main content, to fix this, wrap all the content with the main tag. HTML5 landmark elements are used to improve navigation experience on your site for users of assistive technology.
  • to improve your code, you can do this:
button {
    cursor: pointer;
}

The rest is great!

I hope it helps... 👍

Marked as helpful

0

Elias Lind 130

@EL132

Posted

@AdrianoEscarabote Hey Adriano, thank you so much! After you mention the main content concept, it sounds very familiar :) I'll fix my code and use these tips for my next projects!

0
Adriano 34,090

@AdrianoEscarabote

Posted

@EL132 happy coding!!

0

@Raza7522

Posted

Here is the thing you can consider:

Instead of using 2 <img> tags you should use a <picture> tag:

<picture> <source media="(max-width: 375px)" srcset="./images/image-product-mobile.jpg"> <img src="./images/image-product-desktop.jpg" alt=""> </picture>

Here both images are given in a same tag one with a condition of min-width which will be displayed on that condition automatically. You won't need to crop the image. Hope it helps.

0

Elias Lind 130

@EL132

Posted

@Raza7522 Hello; thank you for the feedback! I didn't know about <picture>, that is a terrific piece of knowledge! Thank you very much.

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