html - What will be indexed better in search engines: img tags or background-images with screenreader tags? -
when building responsive websites use background images render appropriate image appropriate screen size.
eg:
#image { background-image: url(largeimage.jpg); } @media screen , (max-width: 320px) { #image { background-image: url(smallimage.jpg); } }
to let screen readers know kind of element dealing add
role="img"
and
aria-label
here question:
i've learned it's better seo add image company logo in actual image element.
eg
<img src="logo-companyname.png">
the reasoning logo show when google image searching on company name. (presuming website ranked enough)
will google still "scrape" logo when implemented div? eg
<div id="logo-company" role="img" aria-label="company name"></div>
or still need add image somewhere desired result? google @ screen reader tags matter?
use img tag. it's better number of reasons.
when use <img />
- when image need indexed search engine
- if has relation content not design.
- if image not small ( not iconic images ).
- images can add
alt
,title
attribute.
when use css background-image
- images purely used design.
- no relation content.
- small images can play css3.
- repeating images ( in blog author icon , date icon repeated each article etc.,).
based on list above , observations have these reasons use img
tag:
- a logo image has semantic meaning , has relation content. right thing semantical point of view.
- google not automatically index background images, otherwise image search results filled image sprites. google hasn't officially made statement add more value div aria label, although image still have more value. (bing supposedly doesn't though)
so: it's best use img
tag
Comments
Post a Comment