To fix the SVG removal problem (after you have valid HTML), apply the following code to the top of the page instead of the standard <html> .
<html>
This will apply the "lt-ie9" class to the entire page where the IE version is less than version 9. Any version, 9 or higher, will display a normal <html> without a class.
At this point, you have a class that you can use in CSS to remove any element for these browsers.
.lt-ie9 svg {display: none;}
* Disclaimer . It has been a while since I tried this on IE8. It can only work if you transfer the SVG to div.lt-ie9 and instead apply it to the parent element - I donโt remember what errors are thrown. I would test it, but I'm on Ubuntu and without VM on this machine. *
NOTE. . Method for using IE conditional comments in your parent elements: <html> or <body> - Normal, there are many options. You should apply some research in this area and use a more general case than the one given here. This will allow you to get the wider benefits of this technique, as well as solve this problem specifically.
source share