根据我的经验,你不能检查
::after
或
::before
对于IE,所有属性都被划掉了,只是因为在某种程度上,它们不属于所选元素本身,而是属于其pesudo。
我发现,使其看起来像其他浏览器的唯一方法是更改样式的某些属性值
::之前
:
header .wrapper .primary-menu #menu-primary-menu > li > .sub-menu::before {
-ms-flex-item-align: center;
-ms-grid-row-align: center;
align-self: center;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
content: "";
display: block;
height: 470px;
position: absolute;
top: -1rem;
/* Set width to auto */
width: auto;
z-index: -1;
/* Make a huge overflow (i doesn't have to be that big) */
right: -9999px;
left: -9999px;
}
希望有帮助。