Warm tip: This article is reproduced from stackoverflow.com, please click
css html internet-explorer cross-browser pseudo-element

Internet Explorer pseudo elements with background image

发布于 2020-03-29 21:03:19

All versions of modern Internet Explorer (8-11) are displaying an ":after" pseudo element with a background image in it very strangely. It's supposed to be a line of dots that go straight underneath the topnav, as a continuation for the "heart monitor blip". Instead they show up like this:

enter image description here

Here is the site itself: http://www.makingthedifference.ca/

The background image itself is an svg, which I know is not fully supported by all IEs, but according to my tests on BrowserStack, it's being uploaded and showing up fine in IE 9, 10 and 11.

In the IE console on BrowserStack, the :after elements are being completely crossed out, as if IE is finding fault with them, and the dots are showing up unevenly (as pictured above). I do have multiple pseudo elements in there because the site is mobile responsive.

Shows up fine with Chrome, Firefox and Safari.

Also, unfortunately, I can't use border-bottom dotted, the dots are not the right shape.

Questioner
aryazar86
Viewed
22
aryazar86 2014-11-27 00:26

After much finicking, I decided to just re-save the SVG with Adobe Illustrator, and that solved the problem for all versions of IE that support SVGs. I have no idea why the SVG was in error for IE, and why it worked perfectly fine for Firefox, Chrome and Safari, but it did.