Skip to content

Commit

Permalink
fix typo in CSS attr() syntax block
Browse files Browse the repository at this point in the history
  • Loading branch information
JokerQyou authored Oct 21, 2024
1 parent 861008b commit 8cbeca3
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions files/zh-cn/web/css/attr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ CSS 表达式 `attr()` 用来获取选择到的元素的某一 HTML 属性值,
## 语法

```css
/* 关键字值 */
-webkit-touch-callout: default;
-webkit-touch-callout: none;

/* 全局值 */
-webkit-touch-callout: initial;
-webkit-touch-callout: inherit;
-webkit-touch-callout: revert;
-webkit-touch-callout: revert-layer;
-webkit-touch-callout: unset;
/* 简单用法 */
attr(data-count);
attr(title);

/* 带类型或单位 */
attr(src url);
attr(data-count number);
attr(data-width px);

/* 带默认值 */
attr(data-count number, 0);
attr(src url, "");
attr(data-width px, inherit);
attr(data-something, "default");
```

### 解释
Expand Down

0 comments on commit 8cbeca3

Please sign in to comment.