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

Grid, flexbox, etc.

Kris 70

@ly-math

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


Feedback is welcome, this is my first ever project.

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello @zkris-69, Congratulations on completing this challenge!

Your solution its almost done and I’ve some tips to help you to improve it:

1.Use the tag <picture>to wrap the product image inside the html instead of using it as <img> or background-image (with the css). Using <picture> you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make it harder to the image.

Here’s the documentation and the guide to use this tag: https://www.w3schools.com/tags/tag_picture.asp

2.Replace the <h2> containing the main title with <h1> note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in the level of importance, never jump a level. ✌️ I hope this helps you and happy coding!

Marked as helpful

1

Kris 70

@ly-math

Posted

@correlucas thank you for your advice. i'll keep it in mind <3

0
y4rb0w 260

@Yavanha

Posted

Hello,

Very nice job you did there.

I just quickcly went throught your code and here few things that I would do :

  1. avoid working as much as possible with fixed height, use min-height instead.
.container {
    display: grid;
    place-items: center;
    max-width: 50rem;
    height: 100vh; // min-height: 100vh 
    margin: 1.9rem auto;
    padding: 0 1rem;
 }
  1. there is a nice trick for units, is to reset the font size of the html element to 62.5%. This way is easier for you to calculate in rem (10px = 1rem).
  2. for the image what you can do is setting max-width: 100% and the height to auto to correctly fit the container.
 .img img {
    width: 100%; // max-width: 100% and height : auto;
    display: inherit;
  }
  1. always go for a mobile first approach it wil be easier for you to add complexity in the media queries for larger screen.

Hopefully, this is clear enought that you can understand and helps you a little

Marked as helpful

1

Kris 70

@ly-math

Posted

@Yavanha thank you for your advice. i'll keep it in mind <3

1
Rakshith J 240

@rakshithjodukallu

Posted

The way you handled image and details looks nice. Great work keep going mate😃

0

Kris 70

@ly-math

Posted

@rakshithjodukallu thank you, :D

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