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

Hover and click animation Try it out

Rynex Akil 100

@rynex-zv

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


Timing the animation was difficult. delaying 2 seconds to restore the button attribute was hard to find online, it work now but i don't understand some of it. Keeping Css as small as possible need to be improved.

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello @rynex-zv, Congratulations on completing this challenge!

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

1.Using <picture> you’ve more control over the elements and its better than using the product image as <img> or background-image. Look that for SEO and search engine reasons it isn't a better practice to import this product image with CSS since this will make it harder to the image. You can manage both images inside the <picture> tag and use the html to code to set when the images should change setting the device max-width depending of the device (phone / computer) Here’s a guide about how to use picture: https://www.w3schools.com/tags/tag_picture.asp

2.Use units as rem or em instead of px to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.

3.Something that can be a time saver for you is to use a CSS RESET to remove all default settings for margins, making the images easier to work, see the article below where you can copy and paste this css code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/

✌️ I hope this helps you and happy coding!

Marked as helpful

1

Rynex Akil 100

@rynex-zv

Posted

@correlucas Thanks for the tips!

So <picture> is like an <img> media query container in html, nice!

I haven't learned html before, I'm learning it as i go; and things like this are not visible without someone pointing them, thanks so much! I will start including the CSS RESET in my projects😊

2 question though:

1.how do you get the frame size as the solution previewer? I have scaled distances and set them as reference images but when I load the project my container is always smaller than expected so what do you think is going on?

  1. Attribute c not allowed on element button at this point.

Context: <button id=`submeter` class=`card-btn` c=`n`> what else shall I do? is it really wrong? I'm using it to change the animation state and the button is the container of the svg and the span.

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