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

Responsive card component using CSS&HTML

iWatt92 60

@watt92imp

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


Day 3: learning and practicing layouts according to the size of the device with HTML and CSS.

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have other recommendations regarding your code that I believe will be of great interest to you.

HTML 🏷️:

  • This solution contains a minor semantic issue which may cause lack accessibility
  • The old price is not being properly announced, you have used p element for that.
  • Actually there's a native html element which comes handy in these situations. it is del element
  • So you can use like this <del>$169.99</del>
  • These are the tips which improves the accessibility in real world situations.
  • And another thing is that you can consider to change the div with role=main into main element

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

0

iWatt92 60

@watt92imp

Posted

@0xAbdulKhalid Thank you for your advice 😊

0
Rino 340

@Rhinozer0s

Posted

Hey @iWatt92 , 😎

I have a little improvment for your button. You could remove the margin-right property on your <img> element and add this to your button:

display: flex;
justify-content: center;
align-items: center;
column-gap: 0.5rem;

Now your content ist centered. Another useful tip relates to the responsive image. For responsive images you should use the <picture> element. This could look like this:

<picture>
<source media="(min-width:600px)" srcset="image-desktop">
<img src="image-mobile">
</picture>

you can read more about the picture-tag here: https://www.w3schools.com/tags/tag_picture.asp

feel free to ask if there are any other questions. If you are not shure how to implement this, you can look over for my project.

i hope you find that helpfull 🤝

0

iWatt92 60

@watt92imp

Posted

Hi @Rhinozer0s, Thank you for your advice. 😊

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