I am using a document generator called Docfx and it contains own css file. One of the entry in it is,
svg:hover path {
fill: #ffffff;
}
I do not want any change in style when I hover on svg, so I want to disable this. Since I do not have access to modify this css file, only option I have is to use <style>
.
I tested <style>
approach by changing the fill color and it worked. Now, I am not able to figure out how to disable this fill.
<style>
svg:hover path {
<!--fill: #AAAfff;-->
}
</style>
Note: I can also add jquery scripts so if there is a solution based on that, I can use it as well.
2
Answers
fill:none
is not good solution. If you use this, all the styles disappear The style before Hover too.So I found it on the link below. How about writing ‘:not’?
I referred to this link: https://stackoverflow.com/a/40106010/18055787
↓ Forget the answer above. Below is a proven solution ↓
HTML
Add Jquery and The path tag is the child element of the svg tag
If you want the default color of the svg fill, you can just add in style tag.
JAVASCRIPT
If not, try this
If you don’t need any interactions like click events you could override the the
:hover
pseudo state by disabling all point events:As an alternative you could remove the svg’s
<style>
element via javaScript.