css - Firefox:Windows Firefox Web 扩展图标背后的黑色背景

标签 css windows firefox firefox-addon-webextensions

在 Firefox on windows 上,我们得到图标后面的黑色背景(图像设置为背景的范围)。 popup.html内容:

<html lang="en">
  <head>
     <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Project Name| Samlple</title>
  </head>
  <body>
    <ul id="accounts" class="thumbnails">
    <li class="created_from_template autofill">
      <a>
        <span alt="15Five" data-powertiptarget="js-toolTipBody-538" class="app-icon js-toolTip" style="background-image: url(&quot;http://localhost:3000/uploads/service/logo/1/15five.png&quot;);"></span> 
        <span class="notice-icon"></span>
      </a>
      <span id="js-toolTipBody-538" class="js-toolTipBody toolTipBody">
          15Five
      </span>
      <span class="serviceName">15Five</span>
    </li>
  </ul>
  </body>
</html>

和 CSS:

.thumbnails > li > a > .app-icon {
  display: block;
  width: 80px;
  height: 80px;
  background-color: #ffffff;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.thumbnails > li > a > span {
  width: 100%;
  display: block;
  border-radius: 12px;
  max-width: 80px;
}

.thumbnails > li > a:hover > span {
  box-shadow: 0px 1px 4px 2px rgba(0, 0, 0, 0.05);
  transform: scale(1.05);
}

问题:

Icon-with-black-behind

尝试使用过渡,但不是首选,因为那是移动元素。此外,该问题似乎仅限于 Windows 操作系统,在 Linux 上它似乎在 firefox 上运行良好。所以,怀疑是某些图形支持问题。

我怎样才能摆脱这个黑色背景问题?非常感谢您的帮助。

PS:不要在任何地方将背景设置为黑色。

最佳答案

要解决这个问题有点棘手,因为它是特定于平台的渲染问题。

因此,为了解决它,对布局进行了更改。

.thumbnails {
  height: 395px; /* 520px (popup height) - 50px (header) - 55px (search bar) - 20px (Footer) */
  padding: 32px 20px 8px 30px;
  overflow-x: hidden;
  overflow-y: scroll;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  background: #fff;
}
.thumbnails > li {
  flex: 0 0 auto;
  width: 101px;
  min-height: 146px;
  display: block;
  /* please be careful with changing margins and paddings - Firefox on Windows has some rendering issues */
  margin: 0 0 0 -1px;
  padding: 8px 10px 8px 11px;
  border-radius: 12px;
  -webkit-animation: fadeIn .5s cubic-bezier(0.77, 0, 0.175, 1) both;
  animation: fadeIn .5s cubic-bezier(0.77, 0, 0.175, 1) both;
  animation: fadeIn .18s linear both;
  background: #fff;
}

关于css - Firefox:Windows Firefox Web 扩展图标背后的黑色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49876922/

相关文章:

html - 用于定位元素的 Flexbox 或 Column CSS

css - 来自不同类(class)的多个背景

c# - 从 Win64 位的外部进程文件句柄获取文件名 - C#

windows - 从 powershell 触发任务调度程序作业

html - 表格内的表格 - 垂直放置元素而不是水平放置

html - 在 :hover with CSS3 Ease-In Transitions 上显示 Div 覆盖

windows - 为什么没有64位版本的VS2013?

CSS3 关键帧动画在 Firefox 中不起作用

ruby-on-rails - 是否可以让 capybara /webdriver 最小化/不聚焦启动 Firefox?

html - Chrome 和 Firefox 中可折叠元素的不同行为