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

P
Tsukimi 270

@hikawi

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'm most proud of the button sliding in on hover.

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

The button sliding in. Worked it somehow by using two layered buttons, with one's width being 0 and grow to 100% on hover.

Community feedback

P
Steven Stroud 4,100

@Stroudy

Posted

Hey, I can't give many pointers as I haven't used those technology, But some things I noticed,

  • Setting a height and width attribute to your <img> will increase performance to reduce layout shifts and improve CLS, It reserves the space on the page for the image,
  • Page is blocked from indexing, Search engines are unable to include your pages in search results if they don't have permission to crawl them x-robots-tag: noindex.

I look forward to seeing more from you and I hope to use svelte soon!

Marked as helpful

1

@ARiYaNSEp0-0

Posted

@Stroudy hi. good comment and good problem you mentioned but I am not sure if setting aspect ratio would fix that. the solution (which is recommended by many performance test tools) is using width and height attribute. with these attribute image have fix size even when not loaded then when image and css are loaded we don't have shifts anymore

Marked as helpful

2
P
Steven Stroud 4,100

@Stroudy

Posted

@ARiYaNSEp0-0 Hey, I just did a deeper dive and you are correct, setting an aspect ratio for an image in CSS will ensure that the image maintains a specific height and width ratio, but it does not inherently provide the image with a specific height or width. Thank you for bringing that to my attention! :D Updated my comment, let me know if there is anything else I misunderstood I highly appreciate it!

1

@ARiYaNSEp0-0

Posted

@Stroudy your welcome my friend. I am glad that it was helpful for you

1
P
Tsukimi 270

@hikawi

Posted

Thank you both c:

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