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, with Figure and Figcaption

#accessibility

@BhandarkarPawan

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


I would love for someone to review the HTML components I used. I decided to go with the Figure and fig caption elements for the card, instead of the traditional div. This felt appropriate based on the descriptions for these elements on the MDN docs. Is there an benefit or caveat to this approach?

Community feedback

@asmaa-elfatayry

Posted

hello Pawan, you do a great job. to remove accessibility issues you should add the attribute alt to the img tag this attribute appears when something wrong happens to the picture then the "alt" text will appear. you can see more here: https://www.w3schools.com/TAGS/att_img_alt.asp

second : you should add all the content of the body in the <main></main> tag

1

@Aychew10

Posted

Good try there!!! ...as for suggestions, use css background property for images in cases like these where u have multiple images for responsiveness sake(desktop and mobile)

0

@BhandarkarPawan

Posted

@Aychew10 Thanks for your comment. Actually, I did not use two different images here. I just used the single desktop image and used object fit:cover to achieve a similar effect as the mobile image.

0

@Aychew10

Posted

@BhandarkarPawan Yeah, that goes too .....good job anyway

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