Skip to content

Commit

Permalink
Clarify how to set multiple types
Browse files Browse the repository at this point in the history
  • Loading branch information
bramus committed Jan 13, 2025
1 parent fa904cd commit 7bb60ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion files/en-us/web/css/attr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ The parameters are:
```css
attr(id type(<custom-ident>), none)
attr(data-count type(<number>), 0)
```

To accept multiple types, list all allowed `<syntax>`es in the `type()` function, separated by a `|`.

```css
attr(data-size type(<length> | <percentage>), 0px)
```

Excluded from this list is {{CSSxRef("&lt;url&gt;")}} for [security reasons](#limitations_and_security).
For [security reasons](#limitations_and_security) {{CSSxRef("&lt;url&gt;")}} is not allowed as a `<syntax>`.

- The `<attr-unit>` identifier specifies the unit a numeric value should have (if any). It can be the `%` character (percentage) or a [CSS distance unit](/docs/Web/CSS/CSS_Values_and_Units#distance_units) such as `px`, `rem`, `deg`, `s`, etc.

Expand Down

0 comments on commit 7bb60ab

Please sign in to comment.