html - 使用 webkit 更改主体背景颜色会导致故障

标签 html css background webkit

<html>
<head>
<style>
body
{
font-family:'main';
font-size:12px;
background:#180153;
-webkit-animation:liveback 100s;
-webkit-animation-iteration-count:infinite;
}
@-webkit-keyframes liveback
{
0% {background: #180153;}
10% {background: #ad004b;}
20% {background: #7a1c00;}
30% {background: #09664c;}
40% {background: #5e6609;}
50% {background: #9e0b0b;}
60% {background: #9e0b92;}
70% {background: #0023b0;}
80% {background: #2e9100;}
90% {background: #ad8540;}
100% {background: #180153;}
}
</style>
<body> ...<table width=200% style="background:transparent;"><tr><td>..</td></tr>
</table>
</body>
</html>

我的页面有水平滚动(因为里面的表格有 200% 的宽度)..也许这在我的网站上引起了问题,只有 body 的那一部分具有浏览器窗口的高度和宽度..更新新的背景颜色。!看看这张图片,% 值可能是错误的 w.r.t 颜色:1。 First screenshot (Zoom=25%) 2. Second screenshot (Zoom=100%) 访问 www.harshalgajjar.tk 查看表格。

最佳答案

没错问题就是200%的宽度

我认为您可以像这样使用中间 DIV 创建四处走动:

CSS:

@-webkit-keyframes liveback {
  0% {background: #180153;}
  10% {background: #ad004b;}
  20% {background: #7a1c00;}
  30% {background: #09664c;}
  40% {background: #5e6609;}
  50% {background: #9e0b0b;}
  60% {background: #9e0b92;}
  70% {background: #0023b0;}
  80% {background: #2e9100;}
  90% {background: #ad8540;}
  100% {background: #180153;}
}
body {
  width: 100%;
  overflow:hidden;
  font-family:'main';
  font-size:12px;
  background:#180153;
  -webkit-animation:liveback 100s;
  -webkit-animation-iteration-count:infinite;
}

.outer-table{
    width: 100%;
    height: 100%; //or whatever you need
    overflow: scroll;
}

HTML:

<body>
  <div class="outer-table">
    <table width=200% height=50% style="background:none;"><tr><td>..</td></tr>
    </table>
  </div>
</body>

注意:table 不是问题,只是 bodywidth: 200%; 会产生同样的问题

关于html - 使用 webkit 更改主体背景颜色会导致故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19836225/

相关文章:

asp.net - 隐藏一个 td 并折叠行中的其他 td 以不显示 tds 之间的空间(自动合并)

HTML/CSS : Show full size image on click

javascript - Jquery .val 总是为下拉列表返回相同的值

php - 按一定百分比覆盖背景颜色

ios - swift 3+,URLsession,在后台明显随机失败

javascript - Fabric.js 在 Canvas 上的图像上分层文本

css - Bootstrap LESS 中颜色的默认变量?

CSS3 : hide overflow for transform effect

css - 如何在类似于 bootstrap 或 foundation 的语义 ui 中有一行居中的列?

css - 如何为 Bootstrap 网格行添加背景(包括填充!)?