XSL-FO 入门教程 XSL-FO block 对象

2024-02-26 开发教程 XSL-FO 入门教程 匿名 0

XSL-FO block 对象

本节介绍的是 XSL-FO 中的 block 对象,你将了解该对象的定义、语法以及属性。


定义和用法

<fo:block> 对象定义一个输出块。块是矩形框中的输出序列。

<fo:block> 对象用于格式化段落、标题、大字标题,等等。


语法

<fo:block>
<!--
Contents:(#PCDATA|bidi-override|character|
external-graphic|instream-foreign-object|
inline|inline-container|leader|page-number|
page-number-citation|basic-link|multi-toggle|
block|block-container|table-and-caption|
table|list-block)*
-->
</fo:block>

属性

属性 [A-J]属性 [K-Z]
azimuthkeep-together
background-attachmentkeep-with-next
background-colorkeep-with-previous
background-imagelanguage
background-repeatlast-line-end-indent
background-position-horizontalleft
background-position-verticallinefeed-treatment
border-after-colorline-height
border-after-styleline-height-shift-adjustment
border-after-widthline-stacking-strategy
border-before-colormargin-bottom
border-before-stylemargin-left
border-before-widthmargin-right
border-bottom-colormargin-top
border-bottom-styleorphans
border-bottom-widthpadding-after
border-end-colorpadding-before
border-end-stylepadding-bottom
border-end-widthpadding-end
border-left-colorpadding-left
border-left-stylepadding-right
border-left-widthpadding-start
border-right-colorpadding-top
border-right-stylepause-after
border-right-widthpause-before
border-start-colorpitch
border-start-stylepitch-range
border-start-widthplay-during
border-top-colorrelative-position
border-top-stylerichness
border-top-widthright
bottomrole
break-afterscript
break-beforesource-document
colorspace-after
countryspace-before
cue-afterspan
cue-beforespeak
elevationspeak-header
end-indentspeak-numeral
font-familyspeak-punctuation
font-selection-strategyspeech-rate
font-sizestart-indent
font-size-adjuststress
font-stretchtext-align
font-styletext-align-last
font-varianttext-altitude
font-weighttext-depth
hyphenatetext-indent
hyphenation-charactertop
hyphenation-keepvisibility
hyphenation-ladder-countvoice-family
hyphenation-push-character-countvolume
hyphenation-remain-character-countwhite-space-collapse
idwhite-space-treatment
intrusion-displacewidows
wrap-option

实例 1

块是矩形框中的输出序列:

<fo:block
border-width="1mm">
This block of output will have a one millimeter border around it.
</fo:block>

实例 2

块是可独立样式化的输出序列:

<fo:block
font-size="12pt"
font-family="sans-serif">
This block of output will be written in a 12pt sans-serif font.
</fo:block>

实例 3

<fo:block
font-size="14pt" font-family="verdana" color="red"
space-before="5mm" space-after="5mm">
W3CSchool
</fo:block>
<fo:block
text-indent="5mm"
font-family="verdana" font-size="12pt"
space-before="5mm" space-after="5mm">
At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia
and WAP.
</fo:block>

结果:

W3CSchool

相关阅读

XSL-FO 块