We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CSS 中的 attr 属于 Functional Notations ,使用方式类似于编程语言中的方法调用。
attr
在 CSS2.1 中,attr 表达式总是返回字符串。但是在 CSS3 中,attr 表达式可以返回多种类型的数值。虽然说是多种类型,但并不是包含所有类型。
通常情况下,attr 表达式的使用格式为:
attr(<attr-name> <type-or-unit>? [ , <attr-fallback> ]? )
在 CSS3 中,attr 的返回值根据类型划分如下:
<div class="attr-test" data-test="world"> hello </div>
.attr-test:after { content: attr(data-test); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CSS 中的
attr
属于 Functional Notations ,使用方式类似于编程语言中的方法调用。在 CSS2.1 中,
attr
表达式总是返回字符串。但是在 CSS3 中,attr
表达式可以返回多种类型的数值。虽然说是多种类型,但并不是包含所有类型。通常情况下,
attr
表达式的使用格式为:在 CSS3 中,
attr
的返回值根据类型划分如下:举个例子
参考资料
attr
的兼容性The text was updated successfully, but these errors were encountered: