<hr>上的IE10伪元素,负定位不起作用

Shp*_*ord 2 html css pseudo-element internet-explorer-10

我试图在a上负面定位:before:after伪元素<hr>,但IE10很顽固,只是没有显示那些元素.

这是我的例子:http://jsfiddle.net/Shpigford/HyVMR/

除了IE10之外,这似乎在所有浏览器中都能正常工作.它不显示左右块.

它适用于a <div>,但使用a <hr>会导致左伪元素根本不显示

CSS:

hr {
    background:red;
    margin:0 150px;
    height:50px;
    position:relative;
}
hr:before {
    content: '';
    position:absolute;
    height:50px;
    left:-150px;
    width:150px;
    background:green;
}
hr:after {
    content: '';
    position:absolute;
    height:50px;
    right:-150px;
    width:150px;
    background:blue;
}
Run Code Online (Sandbox Code Playgroud)

Mak*_*akc 15

尝试溢出:可见; <hr>

hr {
background:red;
margin:0 150px;
height:50px;
position:relative;
overflow:visible;
Run Code Online (Sandbox Code Playgroud)

}