You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SVG作为网页背景图时如何访问CSS Variables?

问题描述

我需要将一张SVG图片作为网页背景,对应的CSS代码如下:

body{
    background: url('path/to/the/svg/image.svg')
    /* 其他背景属性 */
}

我定义了一个名为--accent-primary-color的CSS变量,用于设置页面的强调色(由用户配置),希望该颜色能作为SVG的主色。SVG文件内的

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 17:04:58