CSS 标准符合性
Antenna House Formatter V7.5 的 CSS 实现基于以下规范:
- [CSS 2.1] Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) (W3C Recommendation 07 June 2011)
- [CSS3-Align] CSS Box Alignment Module Level 3 (W3C Working Draft, 17 February 2023)
- [CSS3-Background] CSS Backgrounds and Borders Module Level 3 (W3C Recommendation 17 October 2017)
- [CSS3-Box] CSS basic box model (W3C Working Draft 9 August 2007)
- [CSS3-Break] CSS Fragmentation Module Level 3 (W3C Candidate Recommendation 9 February 2017)
- [CSS3-Color] CSS Color Module Level 3 (W3C Proposed Recommendation 15 March 2018)
- [CSS3-Content] CSS Generated Content Module Level 3 (W3C Working Draft 2 June 2016)
- [CSS3-CounterStyles] CSS Counter Styles Level 3 (W3C Candidate Recommendation 14 December 2017)
- [CSS3-CustomProperties] CSS Custom Properties for Cascading Variables Module Level 1 (W3C Candidate Recommendation 3 December 2015)
- [CSS3-FlexibleBox] CSS Flexible Box Layout Module Level 1 (W3C Candidate Recommendation 19 November 2018)
- [CSS3-Fonts] CSS Fonts Module Level 3 (W3C Candidate Recommendation 15 March 2018)
- [CSS3-GCPM] CSS Generated Content for Paged Media Module (W3C Working Draft 13 May 2014)
- [CSS3-Grid] CSS Grid Layout Module Level 2 (W3C Candidate Recommendation Draft 18 December 2020)
- [CSS3-Images] CSS Image Values and Replaced Content Module Level 3 (W3C Candidate Recommendation 17 April 2012)
- [CSS3-Inline] CSS Inline Layout Module Level 3 (W3C Working Draft 8 August 2018)
- [CSS3-Line] CSS3 module: line (W3C Working Draft 15 May 2002)
- [CSS3-Lists] CSS Lists and Counters Module Level 3 (W3C Working Draft 20 March 2014)
- [CSS3-Logical] CSS Logical Properties and Values Level 1 (W3C Working Draft 27 August 2018)
- [CSS3-Multicol] CSS Multi-column Layout Module Level 1 (W3C Working Draft 5 October 2017)
- [CSS3-Namespaces] CSS Namespaces Module Level 3 (W3C Recommendation 29 September 2011, edited in place 20 March 2014)
- [CSS3-Page] CSS Paged Media Module Level 3 (W3C Working Draft 18 October 2018)
- [CSS3-Ruby] CSS Ruby Layout Module Level 1 (W3C Working Draft 5 August 2014)
- [CSS3-Selectors] Selectors Level 3 (W3C Candidate Recommendation 30 January 2018)
- [CSS4-Selectors] Selectors Level 4 (W3C Working Draft 11 November 2022)
- [CSS3-Text] CSS Text Module Level 3 (W3C Working Draft 22 August 2017)
- [CSS3-TextDecor] CSS Text Decoration Module Level 3 (W3C Candidate Recommendation 1 August 2013)
- [CSS3-Transforms] CSS Transforms Module Level 1 (W3C Working Draft 30 November 2017)
- [CSS3-UI] CSS Basic User Interface Module Level 3 (W3C Proposed Recommendation 14 December 2017)
- [CSS3-Values] CSS Values and Units Module Level 3 (W3C Candidate Recommendation 29 September 2016)
- [CSS3-WritingModes] CSS Writing Modes Module Level 3 (W3C Candidate Recommendation 7 December 2017)
CSS3/CSS4 规范中有许多仍处于草案或草案之前的状态。虽然上述规范链接到的是 Antenna House Formatter V7.5 实现所依据的版本,但 Antenna House Formatter V7.5 并未完全实现它们。本文档中的每个属性都附有其实现所依据规范的链接。(开头处所写的 [CSS3-GCPM] 等是引用规范时使用的缩写名。)
- 列表中的 [是] 表示该格式化对象或属性已实现。
- [部分] 表示该格式化对象或属性部分实现。
- [否] 表示未实现。
带 [是] 的项目有时存在一些限制,但不影响其完成指定任务的能力。
关于已实现的 CSS3/CSS4 属性及其对应的 XSL-FO 属性,请参阅“XSL/CSS 属性”。
CSS Level 2 Revision 1(CSS 2.1)
4 语法与基本数据类型
5 选择器
| 名称 | 条件 | 备注 |
|---|---|---|
| 5.2.1 分组 (,) | 是 | |
| 5.3 通用选择器 (*) | 是 | |
| 5.4 类型选择器 (E) | 是 | |
| 5.5 后代选择器 (E F) | 是 | |
| 5.6 子选择器 (E > F) | 是 | |
| 5.7 相邻兄弟选择器 (E + F) | 是 | |
| 5.8.1 属性及属性值的匹配([att]、[att=val]、[att~=val]、[att|=val]) | 是 | |
| 5.8.3 类选择器(.class) | 是 | |
| 5.9 ID 选择器(#id) | 是 | |
| 5.11.1 :first-child 伪类 | 是 | |
| 5.11.2 链接伪类: :link 与 :visited | 部分 | 不支持 :visited。 |
| 5.11.3 动态伪类: :hover、:active 与 :focus | 否 | |
| 5.11.4 语言伪类: :lang() | 是 | |
| 5.12.1 :first-line 伪元素 | 是 | |
| 5.12.2 :first-letter 伪元素 | 是 | 只有以下显示模型的元素才有效果。
☞ (-ah-)initial-letters |
| 5.12.3 :before 与 :after 伪元素 | 是 |
6 属性值的指定、层叠与继承
| 名称 | 条件 | 备注 |
|---|---|---|
| 6.2.1 'inherit' 值 | 是 | |
| 6.3 @import 规则 | 是 | |
| 6.4.2 !important 规则 | 是 |
7 媒体类型
| 名称 | 条件 | 备注 |
|---|---|---|
| 7.2.1 @media 规则 | 部分 | 支持“print”和“all”媒体类型。您可以指定名为“ah-formatter”的媒体类型,该 @media 便会被应用。如果使用 Antenna House Formatter V7.5 以外的类型,则会被视为无效的媒体类型。虽然不支持 media-query,但可以指定 not,例如 not screen。 |
8 盒模型
| 名称 | 条件 | 备注 |
|---|---|---|
| 8.3 外边距属性: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'margin' | 是 | |
| 8.4 内边距属性: 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'padding' | 是 | |
| 8.5.1 边框宽度: 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width', 'border-width' | 是 | |
| 8.5.2 边框颜色: 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', 'border-color' | 是 | 值已扩展。 ☞ <color> |
| 8.5.3 边框样式: 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style', 'border-style' | 是 | 值已扩展。 ☞ <border-style> |
| 8.5.4 边框简写属性: 'border-top', 'border-right', 'border-bottom', 'border-left', 'border' | 是 |
9 视觉格式化模型
| 名称 | 条件 | 备注 |
|---|---|---|
| 9.2.4 'display' 属性 | 是 | 该属性已扩展。 ☞ display |
| 9.3.1 定位方案的选择: 'position' | 是 | |
| 9.3.2 盒偏移: 'top', 'right', 'bottom', 'left' | 是 | |
| 9.5.1 浮动的定位: '浮动' | 是 | 支持 float 中的分页(分栏)。 |
| 9.5.2 控制浮动旁的流: 'clear' | 是 | |
| 9.9.1 堆叠级别的指定: 'z-index' | 是 | |
| 9.10 文本方向: 'direction', 'unicode-bidi' | 是 | [CSS3-WritingModes] ☞ unicode-bidi-rev |
10 视觉格式化模型细节
| 名称 | 条件 | 备注 |
|---|---|---|
| 10.2 内容宽度: 'width' | 是 | |
| 10.4 最小宽度与最大宽度: 'min-width', 'max-width' | 是 | |
| 10.5 内容高度: 'height' | 是 | 对于根元素以外的元素,如果父块中未显式指定 height,则使用 % 值的设置会被忽略。在 Antenna House Formatter V7.5 中,当指定了 height 的块被旋转,或 overflow 属性指定了 visible 或 auto 以外的值时,则不会被忽略。 |
| 10.7 最小高度与最大高度: 'min-height', 'max-height' | 是 | 对于表格,min-height 与 height 之间没有区别。当两者都指定时,较大的值将被采用为 height。 |
| 10.8 行高计算: 'line-height', 'vertical-align' | 是 |
11 视觉效果
| 名称 | 条件 | 备注 |
|---|---|---|
| 11.1.1 Overflow: 'overflow' | 是 | 限制:不支持 scroll。该属性已扩展。 ☞ overflow |
| 11.1.2 Clipping: 'clip' | 是 | |
| 11.2 Visibility: 'visibility' | 部分 | collapse 视为 hidden。 |
12 生成内容、自动编号与列表
| 名称 | 条件 | 备注 |
|---|---|---|
| 12.2 'content' 属性 | 是 | 支持 open-quote、close-quote、no-open-quote 和 no-close-quote。在 Antenna House Formatter V7.5 中,该功能已扩展为可将内容应用于具有以下显示模型的元素。
|
| 12.3.1 使用 'quotes 指定引号' 属性 | 是 | |
| 12.4 自动计数器与编号: 'counter-reset', 'counter-increment' | 是 | 当为 counter-reset 指定了非法值(如 0)时,将视为指定了“上一页码 + 1”。 |
| 12.5.1 列表:'list-style-type' | 是 | |
| 12.5.1 列表:'list-style-image' | 是 | |
| 12.5.1 列表:'list-style-position' | 是 | |
| 12.5.1 列表:'list-style' | 是 |
13 分页媒体
| 名称 | 条件 | 备注 |
|---|---|---|
| 13.2 页面盒: @page 规则 | 是 | |
| 13.2.2 页面选择器: 选择左页、右页和首页(:left、:right、:first) | 是 | |
| 13.3.1 分页属性: 'page-break-before', 'page-break-after', 'page-break-inside' | 是 | |
| 13.3.2 元素内部的断开: 'orphans', 'widows' | 是 |
14 颜色与背景
| 名称 | 条件 | 备注 |
|---|---|---|
| 14.1 前景色:'color' | 是 | 值已扩展。 ☞ <color> |
| 14.2.1 背景属性:'background-color' | 是 | 值已扩展。 ☞ <color> |
| 14.2.1 背景属性:'background-image' | 是 | |
| 14.2.1 背景属性:'background-repeat' | 是 | |
| 14.2.1 背景属性:'background-attachment' | 是 | |
| 14.2.1 背景属性:'background-position' | 是 | |
| 14.2.1 背景属性:'background' | 是 |
15 字体
| 名称 | 条件 | 备注 |
|---|---|---|
| 15.3 字体族: 'font-family' | 是 | |
| 15.4 字体样式: 'font-style' | 是 | |
| 15.5 Small-caps: 'font-variant' | 是 | |
| 15.6 字体粗细: 'font-weight' | 是 | 已扩展为可接受 1 到 1000 之间的任意值。 |
| 15.7 字号: 'font-size' | 是 | |
| 15.8 字体简写属性: 'font' | 是 |
16 文本
| 名称 | 条件 | 备注 |
|---|---|---|
| 16.1 Indentation: 'text-indent' | 是 | [CSS3-Text] ☞ text-indent V7.5 |
| 16.2 Alignment: 'text-align' | 是 | |
| 16.3.1 下划线、上划线、删除线与闪烁: 'text-decoration' | 是 | 限制:不支持 blink。 |
| 16.4 字母间距与单词间距: 'letter-spacing', 'word-spacing' | 是 | |
| 16.5 Capitalization: 'text-transform' | 是 | |
| 16.6 Whitespace: 'white-space' | 是 |
17 表格
| 名称 | 条件 | 备注 |
|---|---|---|
| 17.4.1 表题位置与对齐: 'caption-side' | 是 | |
| 17.5.2 表格宽度算法: 'table-layout' | 是 | |
| 17.6.1 分离边框模型: 'border-spacing' | 是 | |
| 17.6.1.1 空单元格周围的边框与背景: 'empty-cells' | 是 | |
| 17.6.2 合并边框模型: 'border-collapse' | 是 |
18 用户界面
CSS3/CSS4
关于已实现的 CSS3/CSS4 属性及其对应的 XSL-FO 属性,请参阅“XSL/CSS 属性”。
选择器
命名空间
| 名称 | 条件 | 备注 |
|---|---|---|
| @namespace | 是 | [CSS3-Namespaces] |
| 限定名(ns|E) | 是 | [CSS3-Namespaces] |
@ 规则
| 名称 | 条件 | 备注 |
|---|---|---|
| @font-face | 部分 | [CSS3-Fonts] ☞ <axf:font-face> / @font-face |
| @footnote | 是 | [CSS3-GCPM] 尚不支持 footnote-display。 ☞ 通过 CSS 实现脚注/旁注 |
| @sidenote | 是 | [CSS3-GCPM] (@sidenote 已于 2010 年 6 月 8 日及之后从 GCPM 中移除) ☞ 通过 CSS 实现脚注/旁注 |
| @page | 是 | [CSS3-Page] 该规则已扩展。 ☞ @page |
| @top-left-corner | 是 | [CSS3-Page] overflow 无效。 |
| @top-left | 是 | |
| @top-center | 是 | |
| @top-right | 是 | |
| @top-right-corner | 是 | |
| @left-top | 是 | |
| @left-middle | 是 | |
| @left-bottom | 是 | |
| @right-top | 是 | |
| @right-middle | 是 | |
| @right-bottom | 是 | |
| @bottom-left-corner | 是 | |
| @bottom-left | 是 | |
| @bottom-center | 是 | |
| @bottom-right | 是 | |
| @bottom-right-corner | 是 | |
| @counter-style | 部分 | [CSS3-CounterStyles] 不能为 symbols 和 additive-symbols 等指定 url()。不支持 speak-as。 ☞ <axf:counter-style> / @counter-style no-LT |
伪类
| 名称 | 条件 | 备注 |
|---|---|---|
| :root | 是 | [CSS3-Selectors] |
| :nth-child() | 是 | [CSS4-Selectors] [of S] 中的 S 不能包含伪元素。 |
| :nth-last-child() | 是 | [CSS4-Selectors] [of S] 中的 S 不能包含伪元素。 |
| :nth-of-type() | 是 | [CSS3-Selectors] |
| :nth-last-of-type() | 是 | [CSS3-Selectors] |
| :first-child | 是 | [CSS3-Selectors] |
| :last-child | 是 | [CSS3-Selectors] |
| :first-of-type | 是 | [CSS3-Selectors] |
| :last-of-type | 是 | [CSS3-Selectors] |
| :only-child | 是 | [CSS3-Selectors] |
| :only-of-type | 是 | [CSS3-Selectors] |
| :empty | 是 | [CSS3-Selectors] |
| :not() | 是 | [CSS4-Selectors] 如果 :not() 参数中的任一选择器是伪元素或无效的伪类,则 :not() 不起作用。 |
| :is() | 是 | [CSS4-Selectors] |
| :where() | 是 | [CSS4-Selectors] |
| :has() | 是 | [CSS4-Selectors] |
| :nth() | 部分 | [CSS3-GCPM] 不支持 <custom-ident>。 |
| 注意: | 当存在可能不生成区域的元素时(例如指定了 -ah-suppress-duplicate-page-number="true" 的情况),:first-child 等可能不会按预期应用。 |
|---|
伪元素
| 名称 | 条件 | 备注 |
|---|---|---|
| ::footnote-call | 是 | [CSS3-GCPM] ☞ 通过 CSS 实现脚注/旁注 |
| ::footnote-marker | 是 | [CSS3-GCPM] ☞ 通过 CSS 实现脚注/旁注 |
| ::sidenote-call | 是 | [CSS3-GCPM] (@sidenote 已于 2010 年 6 月 8 日及之后从 GCPM 中移除) ☞ 通过 CSS 实现脚注/旁注 |
| ::sidenote-marker | 是 | [CSS3-GCPM] (@sidenote 已于 2010 年 6 月 8 日及之后从 GCPM 中移除) ☞ 通过 CSS 实现脚注/旁注 |
| ::marker | 是 | [CSS3-Lists] |
| ::before | 是 | [CSS3-Selectors] 该规则已扩展。 no-LT ☞ CSS ::before / ::after |
| ::after | 是 |
功能
| 名称 | 条件 | 备注 | ||
|---|---|---|---|---|
| content() | 是 | [CSS3-GCPM] | ||
| string() | 是 | [CSS3-GCPM] | ||
| running() | 是 | [CSS3-GCPM] | ||
| element() | 是 | [CSS3-GCPM] element() 不能与任何其他值一起使用,请单独使用。 | ||
| leader() | 是 | [CSS3-GCPM] ☞ leader() V7.5 | ||
| target-counter() | 是 | [CSS3-GCPM] | ||
| target-counters() | 否 | [CSS3-GCPM] | ||
| target-text() | 是 | [CSS3-GCPM] | ||
| device-cmyk() | 是 | [CSS3-GCPM] (CYMK 已于 2014 年 5 月 13 日及之后从 GCPM 中移除) | ||
| rgb() | 是 | [CSS3-Color] | ||
| rgba() | 是 | [CSS3-Color] | ||
| hsl() | 是 | [CSS3-Color] | ||
| hsla() | 是 | [CSS3-Color] | ||
| counter() | 是 | [CSS3-Page] ☞ counter() | ||
| counters() | 是 | [CSS3-Page] ☞ counter() | ||
| attr() | 是 | [CSS3-Values] ☞ attr() | ||
| url() | 是 | [CSS3-Values] ☞ URI | ||
| calc() | 是 | [CSS3-Values] | ||
| linear-gradient() | 是 | [CSS3-Images] ☞ linear-gradient() | ||
| radial-gradient() | 是 | [CSS3-Images] ☞ radial-gradient() | ||
| repeating-linear-gradient() | 是 | [CSS3-Images] ☞ repeating-linear-gradient() | ||
| repeating-radial-gradient() | 是 | [CSS3-Images] ☞ repeating-radial-gradient() | ||
| matrix() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| translate() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| translateX() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| translateY() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| scale() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| scaleX() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| scaleY() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| rotate() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| skew() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| skewX() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| skewY() | 是 | [CSS3-Transforms] ☞ 变换 | ||
| symbols() | 部分 | [CSS3-CounterStyles] 不能指定 url()。 no-LT
| ||
| var() | 是 | [CSS3-CustomProperties] | ||
| repeat() | 部分 | [CSS3-Grid] 不支持两个 repeat() 的插值。 no-LT |
