background-image in div - Google索引? [英] background-image in div – Google indexing?

查看:120
本文介绍了background-image in div - Google索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个空的div列表,并动态插入背景图片 - 所以首先,他们的背景图像:url();属性是完全空的。有些事件,它的background-image url加载到以前空的background-image:url();标签。出现的背景图像的网址暂时存储在div的alt标记中:

I've a list of empty divs and dynamically inserting a background image – so at first, their background-image: url(); property is completely empty. With some event, it's background-image url loads into the previously empty background-image: url(); tag. The url of the appearing background-image is temporarily stored in the "alt" tag of the div:

< div style ='background- image:url();'alt ='http://something...'>< / div>

问题:Google机器人会对这些图片进行索引吗?我可以想象他们做的,因为url已经存储在html代码,而不是在一些外部css文件,但不是作为img标记,而是作为alt或something标签!

Question: does Google robots index those images? I could imagine they do because the url is already stored in the html code and not in some external css-file, however not as "img" tag but as "alt" or "something" tag!?

推荐答案

我认为@ Paolo的回答一般是正确的,但是一些机器人可能会 寻找在页面中引用的任何种类的图像资源 - 这不是不可想象的,当然不是不道德的。

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.

如果您想确保没有搜索引擎对图片进行索引,您可以设置 robots.txt 文件以阻止它们。

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

如果要确保机器人例如,您可以为所有图片设置包含< img> 标签的网页,并将一个无害的链接指向您的首页。

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.

这篇关于background-image in div - Google索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆