Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zh-CN: create Glossary/Canonical_order #23351

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions files/zh-cn/glossary/canonical_order/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: 规范顺序
slug: Glossary/Canonical_order
l10n:
sourceCommit: 7a551aaa034fbada3eb99e6fc924a0313b78307f
---

{{GlossarySidebar}}

CSS **规范顺序**是指需要指定(或{{Glossary("parse", "解析")}})或作为 CSS 属性值的一部分进行{{Glossary("serialization", "序列化")}}的单独值的顺序。它由属性的正式{{Glossary("syntax", "语法")}}定义,通常指的是应该在单个简写值的一部分中指定全称值的顺序。

例如,{{cssxref("background")}} 简写属性值由几个 `background-*` 全称属性组成。这些全称值的规范顺序定义如下:

1. {{cssxref("background-image")}}
2. {{cssxref("background-position")}}
3. {{cssxref("background-size")}}
4. {{cssxref("background-repeat")}}
5. {{cssxref("background-attachment")}}
6. {{cssxref("background-origin")}}
7. {{cssxref("background-clip")}}
8. {{cssxref("background-color")}}

另外,它的语法规定如果给出了 {{cssxref("background-size")}} 的值,则这个值**必须**在 {{cssxref("background-position")}} 的值之后指定,并用斜杠分隔。其他值则可以以任何顺序出现。
jasonren0403 marked this conversation as resolved.
Show resolved Hide resolved

## 参见

- [CSS 值定义语法](/zh-CN/docs/Web/CSS/Value_definition_syntax)
- StackOverflow 上的[“规范顺序”对 CSS 属性的意义有什么?](https://stackoverflow.com/questions/28963536/what-does-canonical-order-mean-with-respect-to-css-properties)给出了进一步有意义的讨论
jasonren0403 marked this conversation as resolved.
Show resolved Hide resolved