8000 update · coder22010/css-tutorial@bc2407f · GitHub
[go: up one dir, main page]

Skip to content

Commit bc2407f

Browse files
author
Wang Pengfei
committed
update
1 parent 7fb3585 commit bc2407f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chapters/019 函数.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444

4545
```css
4646
.my-element {
47-
background: var(--base-color, hotpink);
47+
background: var(--base-color, yellow);
4848
}
4949
```
50-
你还可以给`var()`函数传递第二个参数,表示如果没有找到`--base-color`的定义,函数会以`hotpink`作为返回值(输出)。
50+
你还可以给`var()`函数传递第二个参数,表示如果没有找到`--base-color`的定义,函数会以`yellow`作为返回值(输出)。
5151
<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">
5252
See the Pen <a href="https://codepen.io/AhCola/pen/YzQPVjx">
5353
019 Functions_01</a> by Pengfei Wang (<a href="https://codepen.io/AhCola">@AhCola</a>)
@@ -56,7 +56,7 @@
5656

5757
## 四.有返回值的函数
5858

59-
并不是所有函数都有返回值得`var()`函数恰好是一个有返回值的函数。`attr()``url()`函数与`var()`类似,你可以向它们传递一个或者多个参数,然后将它们作为css声明的属性值。
59+
并不是所有函数都有返回值的`var()`函数恰好是一个有返回值的函数。`attr()``url()`函数与`var()`类似,你可以向它们传递一个或者多个参数,然后将它们作为css声明的属性值。
6060
```css
6161
a::after {
6262
content: attr(href);

0 commit comments

Comments
 (0)
0