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

product preview card solution

@gayathri-v1

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?

I was able to understand the media queries, learnt more on flex and grid.

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

while resizing the screen, the content in the container overlaps with other divs.I should use relative units instead of just px.

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

nothing as such

Community feedback

Pirate 170

@ima9gh

Posted

Hello there!

𝗖𝗼𝗻𝗴𝗿𝗮𝘁𝘂𝗹𝗮𝘁𝗶𝗼𝗻𝘀 𝗼𝗻 𝗰𝗼𝗺𝗽𝗹𝗲𝘁𝗶𝗻𝗴 𝘁𝗵𝗲 𝗰𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲.

𝗬𝗼𝘂𝗿 𝗽𝗿𝗼𝗷𝗲𝗰𝘁 𝗹𝗼𝗼𝗸𝘀 𝗴𝗿𝗲𝗮𝘁.

I have a suggestion to improve your challenge!

●To move the card to the center of the page, change the 𝗖𝗦𝗦 code:

body{ 
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh; 
box-sizing: border-box;
background-color: hsl(30, 38%, 92%);
}

●To make it responsive from :

You should find the size of fonts and other items in smaller sizes to avoid cluttering your project!

𝗧𝗵𝗲𝘀𝗲 𝘀𝗶𝘇𝗲𝘀 𝗺𝗮𝘆 𝗯𝗲 𝘂𝘀𝗲𝗳𝘂𝗹 𝗳𝗼𝗿 𝘁𝗵𝗲 𝗵𝗲𝗶𝗴𝗵𝘁 𝗮𝗻𝗱 𝘄𝗶𝗱𝘁𝗵 𝗼𝗳 𝘆𝗼𝘂𝗿 𝗰𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲.

@media screen and (max-width: 400px){ 
 .container{
 height:300px;
}     
picture .image{
    height: 300px;
    width: 170px;
}
}

@media (min-width: 500px){
.container{
    height:340px;
}
picture .image{
    height: 340px;
    width: 200px;
} 
}

Let me know if this comment was helpful.

𝗚𝗼𝗼𝗱 𝗹𝘂𝗰𝗸 𝗰𝗼𝗱𝗶𝗻𝗴!

Marked as helpful

1

@gayathri-v1

Posted

Hello @ima9gh , Thanks a lot for the feedback! I really appreciate your time for checking my code. I used your suggested code, when I resize the screen the contents in the div does not get overlapped now :) (which the issue earlier) , but mobile view is not working. flex-direction:column; is not working now.

0

@ycezz

Posted

try using :root to save color and font variables, to avoid mistakes in using colors or using fonts

1

@gayathri-v1

Posted

Hello @ycezz, thanks for the suggestion. I will use this in my future projects.

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