图片没有出现在网站上;通过url直接访问 [英] Images not appearing on site; accessible directly through url
问题描述
我有一个HTML网站,它使用了几个不在Chrome中加载的图片。
使用Chrome检查器,我可以看到它们的大小为1px×1px。此外,以下内联样式正在添加到jpgs(不是png): style =display:none!important; visibility:hidden!important; opacity:0!important; background-position:0px 0像素;我的网站上的宽度=0高度=0
,但不在jsfiddle中。 (让我们专注于第一部分。)
当我在本地查看同一站点时,它们显示正常。有没有搞错?看一看: http://jsfiddle.net/3HtPH/2/ 。
编辑:感谢Gaby又名G. Petrioli,我发现这是由于我在Chrome上安装了AdBlock而不是其他浏览器,它阻止了任何名为'ad-_'。AdBlock还会阻止以'ad'开头的大量类和id名称。
非加载图片被命名为 ad -something ..
这意味着您有一个广告拦截器em>浏览器插件),它们阻止那些认为它们是广告的图像。
I have an HTML site that is using several images that do not load in Chrome [edit: and in some people's Firefoxes, not mine].
Using Chrome inspector I can see that they are given a size of 1px by 1px. Plus, the following inline styling is being added to the jpgs (not the png): style="display: none !important; visibility: hidden !important; opacity: 0 !important; background-position: 0px 0px;" width="0" height="0"
on my site, though not in the jsfiddle. (Let's focus on the first part.)
When I view the same site locally, they display fine. What the heck? Take a look: http://jsfiddle.net/3HtPH/2/.
Edit: thanks to Gaby aka G. Petrioli, I figured out that it's due to AdBlock, which I have installed on Chrome and not my other browsers, blocking any resource named 'ad-_.' AdBlock also blocks a whole lot of class and id names that start with 'ad.'
The non-loading images are named ad-something..
That means you have an ad-blocker (browser plugin) that is blocking those images thinking that they are advertisements..
这篇关于图片没有出现在网站上;通过url直接访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!