html - Safari 自动 "display: none !important"不会加载图像

标签 html css image safari

我目前正在构建一个网站,除了几张图片外,其他所有图片都可以正常加载(其他图片加载没有任何问题)。我已经看到图像自动获得 CSS 属性“display: none !important”。

这个问题只发生在 Safari 中(Chrome 可以很好地加载图片!)

HTML:

    <div id="socialLinks">
        <img src="img/social/white/linkedin.png" alt="linkedin">
        <img src="img/social/white/facebook.png" alt="facebook">
        <img src="img/social/white/google.png" alt="google">
        <img src="img/social/white/email.png" alt="email">
    </div>

CSS:

#socialLinks
{
    position: fixed;
    margin-top: -4%;
    float: right;
    top: 7%;
    left: 88vw;
}

我已经尝试了我能想到的一切。 Safari 会找到图像路径,有时会显示 alt 属性。

提前致谢!

最佳答案

广告拦截器的工作方式多种多样,通常会尝试隐藏社交链接/号召性用语。

按顺序并一起尝试这些步骤,看看您必须做什么才能让图像通过您的广告 block :

  1. #socialLinks 的 ID 更改为其他内容
  2. 更改图像的 src 以不从名为 social 的文件夹提供服务
  3. 将每个图像的名称更改为不同的名称,即:icon1.png
  4. 将替代文本更改为没有社交媒体网站名称的内容
  5. 放弃。是您链接的 href 导致它们被阻止

Font Awesome 自己也遇到过这个问题:

"Apparently, Adblock Plus can remove Font Awesome brand icons with their "Remove Social Media Buttons" setting. We will not use hacks to force them to display. Please report an issue with Adblock Plus if you believe this to be an error. To work around this, you'll need to modify the social icon class names." from http://fontawesome.io/icons/

关于html - Safari 自动 "display: none !important"不会加载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34301807/

相关文章:

javascript - javascript中的验证表单,单独点击输入

php - 使用PHP在图像下显示图像名称

php - vimeo 嵌入在 Firefox 上显示黑屏?

Android如何快速获得两个位图之间的差异

c# - 如何查找位图和 JPEG 文件的结构?

javascript - 如何用 javascript 替换图像?

html - 如何使用 thymeleaf 将参数传递给模态?

CSS - 图像上的不同边距取决于文本的数量

旧版浏览器的 CSS3 回退

c++ - 当我要求彩色图像时,Opencv 的 imread 给我一个 2-D Mat,这正常吗?