I have seen several posts on how to style svg’s, but i’m not quite understanding for my situation.
I have some svg images that is simply text. I am exploring avoiding web fonts because of rendering issues. I am trying to style these svg’s by dropping them into the html and styling in css, but this is not working. Can someone help me achieve this?
Here is what i’m trying – In my HTML:
margin: 40px auto 40px;
@include transition(#4a4a4a .1s ease);
Yes, it is the color change I am having issues with. And for the containing div and the svg, I have been struggling with this as well. For some reason If I were to only leave one class, say for the containing div and nothing for the svg, nothing shows up. However, when I placed the class in both section the svg does show up properly…. :-/
Dunno…does it work if you do?
svg.style /* no space */
will only select svg elements that have a class of style…the div element won’t be selected at all.
svg .style /* with space */
will select elements with a class of style **inside** svg elements…and that’s not what you want.
>** img.style, since it’s an img element after all..
Oops…you are right!
In that case…it won’t work at all….it’s just an image.
You can only apply the fill to SVG elements.
is not the same as
Still unable to get this to work…
I’m currently importing the svg code as background data in css
and for my code, I am using
with the codefish code in place of the “[data]”
With my actual svg data before mobilefish
You must be logged in to reply to this topic.