gpt4 book ai didi

css - 使用 HTML 属性作为 CSS 属性值

转载 作者:技术小花猫 更新时间:2023-10-29 11:07:49 25 4
gpt4 key购买 nike

<分区>

规范说:

The attr() function returns the value of an attribute on the element for use as a value in a property. If used on a pseudo-element, it returns the value of the attribute on the pseudo-element's originating element.

http://www.w3.org/TR/css3-values/#attr

但是,这似乎行不通。当我使用 background-image: url(attr(href)); 时,我得到字符串“attr(href)”作为属性值,而不是值本身。

http://jsfiddle.net/x2Rpt/1/

知道为什么这会被破坏吗?

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