I created a svg
image using CorelDraw (export - svg).
Trying to follow the accepted answer here
inside head
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href='navt.css' rel='stylesheet'>
<script>
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
var $svg = jQuery(data).find('svg');
if(typeof imgID !== 'undefined') {
$svg = $svg.attr('id', imgID);
}
if(typeof imgClass !== 'undefined') {
$svg = $svg.attr('class', imgClass+' replaced-svg');
}
$svg = $svg.removeAttr('xmlns:a');
$img.replaceWith($svg);
}, 'xml');
});
</script>
navt.css
.navtsvg{
float:left; // this works
height:21px; // this works
}
.navtsvg rect{
fill:white; // doesn't work
color:white; // doens't work
background:white; // doesn'twork
}
.navtsvg path{
fill:white; // doesn't work
color:white; // doens't work
background:white; // doesn'twork
}
inside body
<img class='svg navtsvg' id='navthome' src='svg/home-01.svg' alt='img'>
Any help?