IE中的多个背景图片,使用CSS在IE中创建多个背景图片 [英] Multiple Background Images in IE, Using CSS to create multiple background images in IE

查看:173
本文介绍了IE中的多个背景图片,使用CSS在IE中创建多个背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次在这里发布。我有个问题。我一直在试图获得多个背景图片工作在Chrome / Safari和IE。当然它可以在除IE之外的所有浏览器。

This is my first time posting here. I have a problem. I've been trying for ages to get multiple background images to work in both Chrome/Safari and IE. Of course it works in all browsers except IE.

这是我的代码

#container {
  width: 828px;
  margin: auto;
  padding: 0;
  text-align: left;
  position: relative;
  overflow: visible;
  background-image: url('images/body.png'), url('images/filler.png');
  background-repeat: no-repeat, repeat-y;
}

我使用两个背景图片的原因是因为我想要图示的部分保持在顶部,并且在添加更多内容时在同一div层中具有白页背景重复。

The reason I am using two background images is because I want the illustrated part to stay at the top, and have the white page background in the same div layer repeat when more content is added.

现在,此代码在Chrome中运行正常,但是在Internet Explorer中显示的背景图片不会出现。

Right now this code works perfectly in Chrome, but NEITHER of the background images show up in Internet Explorer.

帮助?

推荐答案

使用两个容器元素。

HTML

<div id="container">
  <div id="inner-container">
  </div>
</div>

CSS

#container {
  background: url('images/filler.png') repeat-y;
}
#inner-container {
  background: transparent url('images/body.png') no-repeat left top;
}

这篇关于IE中的多个背景图片,使用CSS在IE中创建多个背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆