简体   繁体   English

背景图像无法在Firefox中呈现

[英]Background image does not render in firefox

I have a single webpage. 我只有一个网页。

  <head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title> Welcome to domain.com!</title>
<link href="css/styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
</body>

And a css file 还有一个css文件

body {
    background-image: url("../pics/city7.png");
    background-size: 100% 100%;
    display: inline-block;  }

It works perfectly (scaling) in chrome. 它在chrome中可以完美地工作(缩放)。 But in firefox it is just a bunch of lines. 但是在Firefox中,它只是一堆线。 I tried using display: inline-block - but that does not fix the problem. 我尝试使用display:inline-block-但这不能解决问题。 I am not even sure what it is doing. 我什至不知道它在做什么。 From what I know (and it aint much at this point) is that if I put the image in HTML it will override the CSS - can someone points me in the right direction? 据我所知(此时一点也不重要)是,如果我将图像放在HTML中,它将覆盖CSS-有人可以向我指出正确的方向吗?

In your CSS file, you could write something like: 在您的CSS文件中,您可以编写如下内容:

html {
  min-height: 100%;

}

body {
  background-image: url("../pics/city7.png");
  background-size: 100% 100%;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM