图像被设置为隐藏在网络服务器上

发布于 2024-11-07 01:58:15 字数 1060 浏览 0 评论 0原文

我有一个网站,其中包含 img 标签中的 3 个图像。当我打开本地 html 文件时,一切都很好。但是,当我上传到我的服务器时,除了图像不可见之外,页面是相同的。如果我使用 Chrome 的网络检查器,我可以看到

style="display: none; visibility: hidden; "

浏览器已添加它。如果我取消选中这些样式,图像仍然不可见。 我已经在两个完全独立的网络主机上尝试过。

Firefox 不会添加规则,但它们仍然不可见。

我的代码(在浏览器干扰之前)

<div class="grid_12" id="adswrap">
            <h2>Adverts</h2>
            <div class="grid_3 ads"><img src="images/ads/1.jpg" /></div>
            <div class="grid_3 ads"><img src="images/ads/2.jpg" /></div>
            <div class="grid_3 ads"><img src="images/ads/3.jpg" /></div>
</div>

和样式

.ads{
    height: 185px;
    -webkit-transition: all .2s ease-in-out;
    outline: 2px solid #444;
    margin: 0 35px !important;
}

.ads:hover{
    -webkit-transition: all .2s ease-in-out;
    position: relative;
    top: -5px;
    -webkit-box-shadow: 0px 5px 3px rgba(0, 0, 0, .8);
}

.ads img{
    width: 220px;
}

I have a website which includes 3 images in img tags. When i open the local html file, everything is fine. However, when i upload to my server, the page is identical, apart from the images not being visible. If i use Chrome's web inspector, i can see that

style="display: none; visibility: hidden; "

has been added by the browser. if i uncheck these stylings the image still are not visible.
I've tried it on two totally separate web hosts.

Firefox does not add the rules, but they still aren't visible.

My code (before browser interferes)

<div class="grid_12" id="adswrap">
            <h2>Adverts</h2>
            <div class="grid_3 ads"><img src="images/ads/1.jpg" /></div>
            <div class="grid_3 ads"><img src="images/ads/2.jpg" /></div>
            <div class="grid_3 ads"><img src="images/ads/3.jpg" /></div>
</div>

and the styling

.ads{
    height: 185px;
    -webkit-transition: all .2s ease-in-out;
    outline: 2px solid #444;
    margin: 0 35px !important;
}

.ads:hover{
    -webkit-transition: all .2s ease-in-out;
    position: relative;
    top: -5px;
    -webkit-box-shadow: 0px 5px 3px rgba(0, 0, 0, .8);
}

.ads img{
    width: 220px;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

但可醉心 2024-11-14 01:58:15

您是否安装了广告拦截扩展程序?

也许 img 元素(或其父元素)的 idclass 中的某些内容触发了广告拦截。

我可以想象扩展将允许 localhost 上的任何内容,但是一旦您将其上传到其他地方,广告拦截过滤器就会被激活。

Do you have any advert blocking extension installed?

Maybe there's something about the id or class of the img elements (or their parents) that is triggering the advert blocking.

I can imagine that an extension would allow anything on localhost, but once you upload it somewhere else, the advert blocking filters would be activated.

零度° 2024-11-14 01:58:15

检查您的图像,确保与索引页位于同一文件夹中。

尝试将 标记放在 CSS 样式之外,并尝试托管它。

您是否尝试过使用其他浏览器(例如 Opera)?

Check your image, make sure in same folder with your index page.

Try to put your <img> tag outside your CSS style, and try to host it.

Have you try with another browser such as Opera?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文