我有以下情况:CSS:图像背景 - 如何防止它?
<html>
<head>
<title>
Title
</title>
<style type="text/css">
#wrapper {
width: 100%;
}
#thingy {
position: absolute;
top: 20px;
background-image: url("bg.png");
width: 100%;
height: 4px;
}
</style>
</head>
<body>
<div id="wrapper">
<img src="test.png" alt=""/>
<div id="thingy"> </div>
</div>
</body>
</html>
test.png是相同的图像,bg.png是1×4的背景图像。
问题是:元素#thingy显示在图像的前面,所以一行直接穿过图像。这不应该发生,应该在图像后面显示#thingy。玩Z指数不会做任何事情...
任何提示?
感谢, 约斯特
编辑:更多的细节: 我们的目标是获得一个标题横幅(test.png以上),其下设一个水平线。该行必须跨越标题区域的整个宽度(因此宽度:100%),横幅必须保持居中。
这发生在Chrome和Firefox中,所以我想这不是一个浏览器的具体问题。 – Jost 2012-03-27 19:34:13
为图片提供完全合格的网址(http://“),以便我们可以进行测试 – 2012-03-27 19:36:23