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

css flex and direction

patricknoni22ā€¢ 70

@patricknoni22

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?

working with css flex

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

media quarry responsiveness i use flex directions : column on mobile and flex direction :row on desktop

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

media quarry and css flex

Community feedback

Daniel šŸ›øā€¢ 44,230

@danielmrz-dev

Posted

Hello there!

Congrats on completing the challenge! āœ…

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="(min-width: 768px)" 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!

0
Shoaib Shujaā€¢ 560

@ShoaibShuja

Posted

Amazing job my friend and here are some suggestions for you to make your code better:

  • First of all wrap all your code in a section or div element especially if the design is basically covered in a box.

  • Also don't use section element unless you are covering a bunch of elements which depends on each other or are related

  • Also, in this particular challenge it would have been better to use a img element inside your div instead of putting it as the background

  • Another thing if you want to perfectly center a box inside the body element use these lines of code:

body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
  • If you want to use media queries for smaller devices use @media screen and (max-width: 650px) and not min-width. min-width applies the media query to devices which have a width more than the one you set the property equal to.

You code was overall good and simple. So keep learning and I wish you best of lucks.

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