I have this SVG:
#lockSVG {
display: block;
width: 50px;
height: 65px;
}
#lockSVG .lock-outer-line {
stroke-dasharray: 20 !important;
}
#lockSVG .lock-circle {}
#lockSVG .lock-upper-line {}
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="lockSVG" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 25 35" style="enable-background:new 0 0 25 35;" xml:space="preserve">
<style type="text/css">
.lock-outer-line {
fill:none;
stroke:#686868;
stroke-width:2;
stroke-linecap:round;
stroke-linejoin:round;
stroke-miterlimit:10;
}
.lock-circle {
fill:none;
stroke:#686868;
stroke-width:2;
stroke-linecap:round;
stroke-miterlimit:10;
}
.lock-upper-line {
fill:none;
stroke:#686868;
stroke-width:2;
stroke-linecap:round;
stroke-miterlimit:10;
}
</style>
<path class="lock-outer-line" d="M4.4,13.5c-1.2,0.8-2,2.1-2,3.6v4c0,2.8,1.1,5.4,3.1,7.4c1.9,1.9,4.5,2.9,7.2,2.9c0.1,0,0.2,0,0.3,0
c5.5-0.1,10-4.9,10-10.5v-3.8c0.1-1.8-0.9-3.3-2.4-4l-6.5-2.7c-0.8-0.3-1.8-0.4-2.6,0L10.1,11"/>
<circle class="lock-circle" cx="12.7" cy="21.9" r="2.9"/>
<path class="lock-upper-line" d="M7.1,15.1V9.9c0-3.1,2.5-5.6,5.6-5.6h0c3.1,0,5.6,2.5,5.6,5.6v8"/>
</svg>
and I'd like to style / play with some of its lines. The code inside the snippet works, the stroke-dasharray: 20 !important;
part is rendered, yet, on my end, even if I am to paste <style></style>
next to the SVG itself, after it and even in my original .css
file, it just doesn't take effect.
My markup is: <img id="lock" src="<?php echo esc_url( ../../lock_animatable.svg'); ?>">
, so I'm wrapping my SVG inside an img
tag.
What could I be doing wrong? It's like the document isn't loading the CSS for this SVG alone.