File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 44
44
45
45
``` css
46
46
.my-element {
47
- background : var (--base-color , hotpink );
47
+ background : var (--base-color , yellow );
48
48
}
49
49
```
50
- 你还可以给` var() ` 函数传递第二个参数,表示如果没有找到` --base-color ` 的定义,函数会以` hotpink ` 作为返回值(输出)。
50
+ 你还可以给` var() ` 函数传递第二个参数,表示如果没有找到` --base-color ` 的定义,函数会以` yellow ` 作为返回值(输出)。
51
51
<iframe height =" 300 " style =" width : 100% ;" scrolling =" no " title =" 019 Functions_01 " src =" https://codepen.io/AhCola/embed/YzQPVjx?default-tab=html%2Cresult " frameborder =" no " loading =" lazy " allowtransparency =" true " allowfullscreen =" true " >
52
52
See the Pen <a href="https://codepen.io/AhCola/pen/YzQPVjx">
53
53
019 Functions_01</a> by Pengfei Wang (<a href="https://codepen.io/AhCola">@AhCola</a>)
56
56
57
57
## 四.有返回值的函数
58
58
59
- 并不是所有函数都有返回值得 。` var() ` 函数恰好是一个有返回值的函数。` attr() ` 和` url() ` 函数与` var() ` 类似,你可以向它们传递一个或者多个参数,然后将它们作为css声明的属性值。
59
+ 并不是所有函数都有返回值的 。` var() ` 函数恰好是一个有返回值的函数。` attr() ` 和` url() ` 函数与` var() ` 类似,你可以向它们传递一个或者多个参数,然后将它们作为css声明的属性值。
60
60
``` css
61
61
a ::after {
62
62
content : attr (href );
You can’t perform that action at this time.
0 commit comments