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

3-column preview card component

Siva 210

@sivakumars

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi all,

Learning a bit about SVG files and their usage, I have used SVG sprites for this challenge. Please give me feedback if I have used it correctly.

Community feedback

@rafdidact

Posted

Hey, Siva!

  • If your svg takes the role of an static image, an img tag will do the job. It allows for an alt property, which you should use:
<img src="image.svg" alt="cat">
  • If you want a more powerful svg, use object. It allows for referring your svg from outer document, so that you can manipulate it with JavaScript:
<object id="svg1" data="image.svg" type="image/svg+xml"></object>

Hope it helps.

Marked as helpful

1

Siva 210

@sivakumars

Posted

Hi, @rafdidact!

Thanks a lot for your feedback.

Initially, I used <img /> tags for displaying images, then I thought I will use SVG sprites to replace three SVG images with one SVG image. Maybe , it doesn't matter much in this small challenge. Also , I learned a bit about how SVG viewbox and viewport works.

I think I should have used aria tags to make those icons accessible. Thanks for introducing me to the object element. I will keep this in my mind for SVG animations.

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