【发布时间】:2012-02-09 18:29:03
【问题描述】:
我目前在 IE 中的 z-index 存在问题。
我有一个 div,这个 div 中有一个图像,这个图像上有一些文字。
这是我的 HTML 代码:
<section id="content_right">
<div class="mini_bloc_image">
<img alt="Camionnette VCI" src="img/mini_reparation_site_nb.png" />
<span><a href="#">Réparation sur site</a></span>
<span>Nous nous déplaçons</span>
</div>
和 CSS:
#content_right {
width: 230px;
height: 484px;
float: right;
}
.mini_bloc_image {
height: 148px;
margin-bottom: 20px;
position: relative;
}
.mini_bloc_image > img {
position: absolute;
}
.mini_bloc_image > span:first-of-type {
display: block;
position: absolute;
top: 95px;
left: 0px;
font-size: 1.1em;
background-color: #ffffff;
padding: 4px 5px 4px 5px;
}
.mini_bloc_image > span:last-of-type {
display: block;
top: 95px;
left: 0px;
position: absolute;
left: 50px;
top: 125px;
color: #ffffff;
font-size: 1.1em;
font-family: 'Marck Script', cursive;
}
IE 不理解我的文字必须在图像上方...
我找到了一些类似 http://www.adrenatie.com/z-index-et-ie6/ 或 http://systembash.com/content/css-z-index-internet-explorer/ 的解决方案,但它不起作用。
有人可以帮帮我吗?
【问题讨论】:
-
您是专门询问 IE6 的吗?
-
你真的需要 :first-of-type 和 :last-of-type 吗?
-
我猜是的,因为它们没有相同的字体和外观。
标签: html css internet-explorer z-index