在所有其他浏览器上,除Firefox之外,该网页均正常。甚至是Internet Explorer!伪元素在整个文档中浮动,甚至在第一个伪元素之后也不显示。这种行为有什么解决办法吗?
的CSS
span[property="dc:date dc:created"]::before{
position: absolute;
top: 60px;
content: '';
display: block;
background-color: #005691;
width: 60px;
height: 20px;
}
span[property="dc:date dc:created"]::after{
position: absolute;
top: 60px;
right: 0;
width: 0px;
height: 0px;
border-top: 20px solid #01416F;
border-right: 20px solid rgba(0, 0, 0, 0);
content: '';
}
您需要将绝对定位的伪元素定位relative
到父元素。此外,inline-block
还添加了以包含父元素的宽度。
.submitted {
position:relative;
display:inline-block;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句