css - Colorize transparent part of SVG icons
问题描述
I want to colorize a transparent part of a svg icon from font awesome. I am using Vue Fort-Awesome package.
Here as you see inner part of icon is getting the background image of my main div. However I don't want those part to be transparent. Do you have any tricky solution for it? I know this question can be very easy but I couldn't find how to search for it on google.
<v-icon
icon="minus-circle"
class="w-6 h-6 rounded-full text-red-500"
/>
Those are technologies that I use but simple css trick can be acceptable too.
Tailwind
Vue3
FortAwesome
解决方案
您可以通过更改fill
部分中的十六进制值来更改减号或圆圈的颜色。对于其他图标,您可以通过编辑 svg 文件来更改颜色。
<svg width="200" height="200" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="100" r="100" fill="#00970F"/>
<rect x="39" y="88" width="123" height="25" rx="10" fill="#FA00FF"/>
</svg>
推荐阅读
- javascript - 不使对象指针相同的正确方法
- xcode - MLModel 如何分析 ImagePicker?
- c - C:使用pthreads的线程同步,锁定和解锁互斥锁
- c# - AWS Lambda Dot Net Core 3.1 在使用 Aspose Cells for .Net 时抛出 gdip 异常
- mysql - 对部分字符串使用 HAVING 截断值错误的 sql 子句
- docker - 无法挂载到 Kubernetes 中的 nfs pod
- php - PHP CURL在HTTPHeader中传递连接变量
- javascript - “按键”事件开启
- postgresql - 使用最新版本的 Postgresql psql 客户端工具时无法连接到 Postgres 服务器
- docker - Docker 上的 Nginx - proxy_pass to Directory 给出 404