0

I have div wrapper and the background is white, I also have a body background (its an image) I want to have a div inside my wrapper with no white background, basically I am looking to make that div transparent to the wrapper background.

<div style="background:none;">ghjhjghjghj</div>

Any suggestions?

Edit:

I'm trying to make the body background appear trough a div that is inside another div that have a white background. Is this possible?

4

2 回答 2

2

透明背景颜色适用于这个简单的示例......

http://jsfiddle.net/rD93B/1/

更多 HTML/CSS 将有助于识别您遇到的问题。

并在容器 div 上使用白色背景颜色更新了 jsfiddle ...

http://jsfiddle.net/rD93B/3/

另一个更新....

http://jsfiddle.net/rD93B/6/

这显示了容器 div 的背景颜色而不显示背景图像

CSS

div#outer {
  background-color: green;
  background-image: url(http://static4.grsites.com/archive/textures/red/red001.jpg);
  width: 200px;
  height: 200px;
  z-index: 1;
}


div#inner {
  background-color: inherit;
  background-image: none;
  width: 100px;
  height: 100px;
  border: solid 2px yellow;
  color: yellow;
  z-index: 0;
}

HTML

<div id="outer">
<div id="inner">
</div>
</div>
于 2012-09-22T06:18:14.800 回答
0

使用 background-color 属性并将其设置为:在您的内部 div 上透明。

<div style="background-color: transparent;">ghjhjghjghj</div>
于 2012-09-22T05:52:13.427 回答