2017-08-04 58 views
0

中的代码问题:http://jsbin.com/bisimeyija/edit?html,css,output微软边缘不尊重某些伪元素的CSS

它工作正常,在Chrome/Safari/Firefox和甚至IE11我相信。

HTML

<div class="img-Offset"> 
    <div class="img-Offset_ImageContainer"> 
    <img src="http://placehold.it/430x350" alt=""> 
    </div> 

    <p class="img-Offset_Caption">Scott Preston and his wife Laura</p> 
</div> 

:root { 
    --Theme_Primary-dark: #f98183; 
} 

CSS

.img-Offset { 
    position: relative; 
    z-index: 1; 

    max-width: 520px; 
    width: 100%; 
} 

.img-Offset::after { 
    content: ''; 

    position: absolute; 
    top: 90px; 
    right: 0; 
    bottom: 0; 
    left: 0; 
    z-index: -1; 

    display: block; 

    background-color: var(--Theme_Primary-dark); 
    border-radius: 5px; 
} 

.img-Offset_ImageContainer { 
    position: relative; 

    padding-left: 90px; 

    border-radius: 5px; 
    border-bottom-right-radius: 0; 
} 

.img-Offset_Caption { 
    margin-top: 14px; 
    padding-right: 30px; 
    padding-bottom: 21px; 
    padding-left: 90px; 

    font-weight: 500; 

    color: #fff; 
} 

在边缘,它看起来像:image 它应该看起来像:image

所以,出于某种原因,border-radiustop不是工作在伪,但其他一切都是。

+2

这是由于对伪元素中CSS定制属性/变量的错误支持:请参阅https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/ – Terry

回答

3

它似乎是一个关于使用CSS变量的问题。如果您将背景颜色更改为简单的十六进制值,问题就会消失。