Design comparison
Solution retrospective
Can you assist me in centring a view icon? I seem to be having some difficulty. How can I remove accessibility warnings?
Community feedback
- @JaneMorozPosted over 1 year ago
Hey! Very nice solution 🎉
- I guess you got some 'landmark something warnings'. I get them when I forget to wrap the main content of the page into the
main
tag. So I suggest you to usemain
tag instead ofdiv
withclass="main"
- Instead of
h3
I suggest to useh1
and then style it. - Maybe it's better to wrap
Jules Wyvern
into thea
instead ofp
since it seems to be a link and then style it because link tag usually has default underlying etc.
Keep it up! And good luck 🍀
1@copyninja07Posted over 1 year ago@JaneMoroz Thank you for your suggestion it helps. I'll try your suggestion. can you also help me with the view icon I can't able centre it in the div?
1@JaneMorozPosted over 1 year ago@copyninja07
I looked at "view" icon svg file, it has some weird width and height:
<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h48v48H0z"/><path d="M24 9C14 9 5.46 15.22 2 24c3.46 8.78 12 15 22 15 10.01 0 18.54-6.22 22-15-3.46-8.78-11.99-15-22-15Zm0 25c-5.52 0-10-4.48-10-10s4.48-10 10-10 10 4.48 10 10-4.48 10-10 10Zm0-16c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6Z" fill="#FFF" fill-rule="nonzero"/></g></svg>
So I guess that changing
width
andheight
might solve it (not sure 100% that it will give a desired result because working with svg can be tricky, very often I don't useimg
tag with it, I just use it as it is. Then you can style it'ssvg
,path
etc).Then since icon's
img
is wrapped indiv
I suggest to style thisdiv
as a background and then centreimg
inside of it by usingflex
.Marked as helpful1@copyninja07Posted over 1 year ago@JaneMoroz Thank you for your help. I finally made all the changes and it's working.
1 - I guess you got some 'landmark something warnings'. I get them when I forget to wrap the main content of the page into the
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