Design comparison
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
- @rafdidactPosted almost 2 years ago
Hey, Siva!
- If your svg takes the role of an static image, an
img
tag will do the job. It allows for analt
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 helpful1@sivakumarsPosted almost 2 years agoHi, @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 theobject
element. I will keep this in my mind for SVG animations.1 - If your svg takes the role of an static image, an
Please log in to post a comment
Log in with GitHubJoin 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