对,我有一个标题和一个小格.sideShadow,我需要.shideShadow div来要落后#sideTopHeader格,现在它是在顶部它,你可以在这里(在你的右边),看看它对齐问题 - z-index的问题
CSS我现在用
#sideTopHeader {
background: #333333;
z-index: 1;
position: relative;
height: 50px;
margin: 0 -30px 0 0;
-webkit-border-radius: 7px 7px 0 7px;
-khtml-border-radius: 7px 7px 0 7px;
-moz-border-radius: 7px 7px 0 7px;
border-radius: 7px 7px 0 7px;
}
.sideShadow {
border-color: transparent transparent transparent #1f1f1f;
border-width: 15px;
border-style: solid;
height: 0;
width: 0;
position: absolute;
top: 35px;
left: 395px;
z-index: 0;
}
你能解释一下这个伪元素是什么?我第一次了解它 – Ilja
请注意,伪选择器在IE7中不起作用,并且在IE8中不可靠。 – kinakuta
@kinakuta这就是为什么我最好链接到sitepoint.com参考: http://reference.sitepoint.com/css/pseudoelement-after#compatibilitysection ;-) – feeela