Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is IE 11 not rendering :after element, showing css as crossed out in dev tools?

I have an angular app with two font icons in a given screen. These are rendered just fine in chrome, firefox and edge, but on IE 11 they do not display. The icons are to be rendered as the content of the :after pseudo class, which according to my research should work fine on IE 9 and up. However, on IE, these are simply not rendered.

As you can see in the screenshot, the :after element is not in the DOM displayed in the dev tools, and the css is correct but shows crossed out in dev tools:

IE 11 shows css for :after element crossed out, nothing is rendered

The relevant CSS that is compiled and actually used in the screen showing the issue is like so:

.profile-picture[_ngcontent-vem-9]:after {
    font-family: Material Icons;
    content: "\E3B0";
    font-size: 48px;
    top: 32px;
    left: 25px
}
.profile-picture[_ngcontent-vem-9] .title[_ngcontent-vem-9],
.profile-picture[_ngcontent-vem-9]:after {
    display: block;
    position: absolute;
    color: #9e9e9e;
    transition-duration: .3s
}

The rules above the crossed out ones are unrelated. But since someone asked to see them, here they are:

enter image description here

The question is: why is this happening, and how to fix it?

like image 549
Edy Bourne Avatar asked Feb 06 '17 20:02

Edy Bourne


People also ask

Does CSS work in Internet Explorer?

CSS all property is Not Supported on Internet Explorer 10. If you use CSS all property and your users are using Internet Explorer 10, then they would see the feature properly. That doesn't guarantee that other web technologies are also compatible in Internet Explorer 10 though.


1 Answers

I had a similar issue, the after element on an <a> tag wasn't rendered in IE11, though I could see the CSS style for it. Freddie's answer here solved the issue for me. Add this to the css display: block;

like image 83
THawkins Avatar answered Nov 16 '22 03:11

THawkins