白色块在Ubuntu的网页背景中

时间:2015-02-06 19:38:35

标签: html css ubuntu

我正在使用Ubuntu 14.10开发一个网站。

Chrome无法正确渲染背景。底部呈现精细,这是覆盖整个宽度的页脚。然而,内容div的背景只是白色。

查看图片以供参考(我是Stackoverflow的新手,需要更多代表发布图片):

https://www.dropbox.com/s/rqnlg9eh4k7cbv5/white-background-os.png?dl=0

OS X或Windows上不会出现此问题,浏览器的选择不会影响问题。

我正在使用Alienware M14X R2,所以我想也许Nvidia驱动程序可能是问题,但它们是最新的。

背景代码:

它只发生在这个特定的网站上,所以我猜测我的CSS出了问题。有点奇怪的是,它只是用Ubuntu(我猜其他几个Linux发行版)

基本上我有这个:

HTML(homepage.ejs)

<div ui-view ng-app="myApp" id="wrap-content">
   <!--Content swapped with Angular and ui-router-->
</div>

CSS:

@media screen and (min-width: 1024px) {

  html {
    background: url("images/bg.jpg") no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
  }

  div#wrap-content {
    width: 900px;
    height: 84vmin;
    overflow: hidden;
    margin: 0px auto;
    position: relative;
    top: 45px;
  }
... a bunch of other stuff
}

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

好的,所以我偶然解决了这个问题。将背景应用于HTML导致了这个奇怪的问题。将其更改为:

body {
    background: url("images/bg.jpg") no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

解决了这个问题。希望这对任何遇到同样问题的人都有用!