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

My Product Preview Card made with Bootstrap v5.0

@idlehands1969

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


This is my first Frontend Mentor challenge and I want to make sure I have followed the challenge instructions correctly. The style-guide says the designs were created to 375px and 1440px respectively for the mobile and desktop versions. Did this mean the width of the document body or the card itself? I assumed it was the body and gave the card a fixed width of 720px for desktop and 375px for mobile. The desktop version was way too big at 1440px wide in my opinion. However, I would make it that big if that was the requirement.

It took me many tries to finally get the code to work the way I wanted it to. I first tried flexbox, then css grid, and ultimately bootstrap was the only way I could get the image and non-image sections to be the same height, although that may be because I finally gave the card a fixed width in both versions. I'm not sure.

Constructive criticism would be appreciated.

Community feedback

Lucas πŸ‘Ύβ€’ 104,420

@correlucas

Posted

Hello Marta, welcome to the frontend mentor community!

Answering your question about the sizes, the sizes 1440px and 375 are just a reference to know in which dimensions the design were created. You can follow this but not stick these numbers since your solution will be open in multiple screens. A value you should follow is the container size, for example, this container has around max-width: 900px.

To do this challenge I choose GRID, here's my approach to build this component with 2 columns

All you need to do is create a main block to hold all the content (you can use <main> to wrap), set its width as max-width: 900px (it's the container size) and display: grid / grid-template-column: 1fr 1fr(this means that your component will have two columns with 50% of the container width each thats 450px).

Hope it helps and I want to see your next challenges.

Marked as helpful

0
Divine Obetenβ€’ 2,415

@Deevyn9

Posted

Hi Marta, congrats on completing this project, to answer your question concerning the widths, the specified width in the documentation isn’t for the size of the container, those are the widths of the devices that the screenshots were taken at.

Marked as helpful

0

@themegazord

Posted

Hello my dear.

First of all, congratulations for your effort in finishing your first project here with us :)

Next, when he says 1440px Desktop and 375px Mobile, it's the size of the screen itself and not the card. The card will have to adapt to all dimensions between 1440px and 375px.

So your card should follow the following logic:

375px < your card < 1440px.

Adaptations will be given responsively, using @media.

Second, it's ok for you to use Bootstrap, being that it was the only way you could but the ideal was to try with CSS Flex or CSS Grid.

A tip, for you to center everything in the center, you can use the following:

body{ display: flex; flex-direction: row; justify-content: center; align-items: center; min height: 100vh; }

This will make your card stop in the middle, the rest you will adjust according to what is necessary. If you want, I'll leave my repository of this exercise for you to see how it looks.

Hope this helps.

If possible, mark as helpful :-)

It helps me a lot.

Github: https://github.com/themegazord/Product-Preview-Card-Component Live Site: https://incandescent-phoenix-6d0d26.netlify.app

Marked as helpful

0
Raz Israeliβ€’ 50

@PishoTo

Posted

Hey Marta, Looks very nice!

I am new to frontend development, so unfortunately I can't provide any feedback for improvement. Even though, I can say that it looks really good and well done! :)

The only thing I saw is that there is a small overlapping between the 2 elements (the image and the text) when switching to a mobile screen size, and I think that the bottom-left corner of the image still has a border-radius there which is not needed in this screen size :)

Great job, Raz

Marked as helpful

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