gpt4 book ai didi

使用 SVG Base64 URI 的 CSS 光标图像

转载 作者:太空宇宙 更新时间:2023-11-04 03:33:29 25 4
gpt4 key购买 nike

所以我将这个 SVG 元素编码为 Base64:

cursor: url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEzLjU1N3B4IiBoZWlnaHQ9IjEyLjI3M3B4IiB2aWV3Qm94PSIwIDAgMTMuNTU3IDEyLjI3MyIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTMuNTU3IDEyLjI3MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTMuMDA4LDEuMTg5YzAuNDgtMC4xNzksMS40MjctMC4wNjksMS42NzcsMC40NzNjMC4yMTMsMC40NjIsMC4zOTYsMS4yNDEsMC40MDYsMS4wNzUgQzUuMTE1LDIuMzY4LDUuMDY3LDEuNTcsNS4yMjgsMS4xNTNjMC4xMTctMC4zMDUsMC4zNDctMC41OSwwLjY4Ni0wLjY5MmMwLjI4NS0wLjA4NSwwLjYyMS0wLjExNCwwLjkxNy0wLjA1NCBjMC4zMTIsMC4wNjQsMC42NDIsMC4yODcsMC43NjUsMC40OTlDNy45NTgsMS41Myw3Ljk2MywyLjgwNiw3Ljk4LDIuNzM3YzAuMDY0LTAuMjcxLDAuMDctMS4yMjksMC4yODMtMS41ODQgQzguNDA0LDAuOTE4LDguNzYsMC43MDgsOC45NTEsMC42NzVjMC4yOTQtMC4wNTMsMC42NTUtMC4wNjgsMC45NjQtMC4wMDhjMC4yNDksMC4wNDksMC41ODYsMC4zNDQsMC42NzcsMC40ODYgYzAuMjE5LDAuMzQ0LDAuMzQyLDEuM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iIHgyPSIxMC4wMDEiIHkyPSI1LjQyOSIvPjxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAxMDEwMSIgc3Ryb2tlLXdpZHRoPSIwLjc1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHgxPSI3Ljk4NiIgeTE9IjguODk5IiB4Mj0iNy45NyIgeTI9IjUuNDI3Ii8+PGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDEwMTAxIiBzdHJva2Utd2lkdGg9IjAuNzUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgeDE9IjUuOTkiIHkxPSI1LjQ1OCIgeDI9IjYuMDExIiB5Mj0iOC44ODQiLz48L3N2Zz4=), auto;

但是这个特定的版本,data:image/svg+xml,似乎不起作用。如果我将它用作背景,它确实可以,但我似乎无法让它为光标工作。

关于为什么这不起作用的任何想法或见解?

最佳答案

您使用的是哪种网络浏览器?您的代码在 Google Chrome 中运行良好。

根据 https://developer.mozilla.org/en-US/docs/Web/CSS/cursor/url 的规范它也应该在 Firefox 中工作。

我猜您使用的是 Internet Explorer?根据 http://msdn.microsoft.com/en-us/library/ie/aa358795(v=vs.85).aspx 处的 IE 文档, cursor: url(uri); 属性必须是 .cur 或 .ani 文件。看起来 IE 不支持 SVG 游标,除了通过 SVGCursorElement 在 SVG 文件中(详情请参阅 http://msdn.microsoft.com/en-us/library/ie/bg124137(v=vs.85).aspx)。

关于使用 SVG Base64 URI 的 CSS 光标图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25957187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com