0

如果您查看此页面:http ://www.groenesmoothiehandboek.nl/sp/ ,您会看到视频稍微偏离中心。

您还会看到上面有一个计数器 (flipclock.js)。要调用计数器,我们使用以下代码:

<div style="width:100%; background:url(img/bg-countdown.png) center top no-repeat; height:140px; margin:0 auto; z-index:9999;">

如果我删除这部分,视频将完美居中。

我已经尝试修复这个小错误一个多小时但没有成功。

有谁知道我可以如何解决这个问题?

提前致谢!

4

2 回答 2

0

如果你包装这个 div:

<!-- notice no height attribute here -->
<div style="width:100%; background:url(img/bg-countdown.png) center top no-repeat; margin:0 auto; z-index:9999;">
  <!-- stuff from inside this div -->
</div>

在这个 div 里面:

<div style="height: 140px;">
  <!-- Place the entire div from above here -->
</div>

您的问题已解决。

图片:http: //i.imgur.com/HBiLUOz.png

于 2014-12-16T08:58:15.800 回答
0

我想我已经为你解决了这个问题:

添加float: left到柜台的包装纸上。(具有这些属性的

{ 
width: 100%;
background: url(img/bg-countdown.png) center top no-repeat;
height: 140px;
margin: 0 auto;
z-index: 9999;

}

将这些添加到它下面的 div

width: 100%; 
float:left;

(具有这些属性的 div):

background:url(img/bg-vid.jpg) center top no-repeat; 
height:878px;
max-width:1920px;
margin:0 auto;

应该修复。我强烈建议您使用类和 id 来添加 CSS :)。这种方式更具可读性。祝你好运,冰沙;)

于 2014-12-16T09:01:52.827 回答