background-image in div – Google indexing?

寵の児 提交于 2019-12-01 12:04:42

I think @Paolo's answer is correct in general, but some bots might look for any kind of image resource referenced in the page - it's not unthinkable, and certainly not unethical.

If you want to make sure no search engine indexes the images, you can set up your robots.txt file to block them.

If you want to make sure bots do index them, you could for example set up a page containing <img> tags with all the images, and put an innocuous link to that page onto your front page.

Googlebot (like most spiders) does not attempt to run javascript, so the only things it will index are the things appearing in the original HTML downloaded from the server. Any subsequent manipulation by JQuery just won't happen.

Also - most spiders don't index CSS either so background-images will also be ignored for that reason.

Googlebots will certainly index IMG ALT attributes. Whether or not they subsequently detect the fact that alt texts contain URLs and go looking at them, I really don't know.

This seems to me an abuse of the alt attribute, frankly: DIVs shouldn't (don't) have ALT attributes, and even if they did, this is not what they are for.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!