简体   繁体   English

按钮CSS内的SVG颜色变化

[英]SVG color change inside a button CSS

I am having a trouble changing the color of SVG along with the button.我在更改 SVG 和按钮的颜色时遇到了麻烦。 I want SVG color to change when I hover onto a button with SVG in it, now it works just when I hover over an SVG image inside that button.当我将鼠标悬停在带有 SVG 的按钮上时,我希望 SVG 颜色发生变化,现在它只在我将鼠标悬停在该按钮内的 SVG 图像上时才起作用。 Here is what I got so far:这是我到目前为止所得到的:

 .round { display: inline-block; width: 120px; line-height:118px; background-color: rgba(100, 100, 100, 0); border:2px solid #0090ff; -webkit-border-radius: 200px; -moz-border-radius: 200px; border-radius: 200px; cursor:pointer; -webkit-transition: all .2s ease-out; -moz-transition: all .2s ease-out; } .round:hover { background-color: #00aaee; border:2px solid #0080b3; } .svg:hover { filter: brightness(1000%) saturate(0%) contrast(1000%); }
 <a href="/category/aktualnosci/" class="round"><img class="svg" src="/wp-content/uploads/2019/12/gazeta.svg" width="60" height="60"></a><br>

Something like : .round:hover .svg { filter: brightness(1000%) saturate(0%) contrast(1000%); }类似于: .round:hover .svg { filter: brightness(1000%) saturate(0%) contrast(1000%); } .round:hover .svg { filter: brightness(1000%) saturate(0%) contrast(1000%); }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM