简体   繁体   English

如何在Zurb Foundation 4中为div添加背景图像?

[英]How do you add a background image to a div in Zurb Foundation 4?

This seems like it'd be terribly easy but I couldn't get the standard method to work? 这似乎非常容易,但是我无法使用标准方法?

HTML 的HTML

[div class="test"] [/div]

CSS 的CSS

.test {
     position: fixed;
     left: 0px;
     top: 0px;
     width: 100%;
     height: 100%;
     overflow: hidden;
     background-image: url(http://upload.wikimedia.org/wikipedia/commons/6/60/ISSFinalConfigEnd2006.jpg);
     z-index: -1000;
}

I had to use square brackets because the greater than/less than brackets would not show up in this textfield. 我必须使用方括号,因为该文本字段中不会显示大于/小于括号。

It has nothing to do with Foundation, it's a CSS issue. 它与Foundation无关,这是CSS问题。

If you want to add a background image to your site (I guess that's the point), why don't you simply do this: 如果您想在网站上添加背景图片(我想这就是重点),那么为什么不简单地这样做:

body {
background: url('http://upload.wikimedia.org/wikipedia/commons/6/60/ISSFinalConfigEnd2006.jpg') no-repeat top left;
}

Additionally: http://www.w3schools.com/css/css_background.asp 另外: http : //www.w3schools.com/css/css_background.asp

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

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