无法更改XSL-FO中列表项之间的空间

时间:2013-08-06 15:08:50

标签: list xsl-fo

provisional-label-separation属性似乎不会影响间距。我还尝试了margin-*padding-*space-beforespace-after,但列表项之间的空间仍然不会改变。如何更改列表中列表项之间的垂直空间(如果这会产生影响,我将渲染为PDF)?

<fo:list-block provisional-distance-between-starts="3mm" 
               provisional-label-separation="3mm" 
               space-after="3mm" >

    <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()" font-size="9pt">
            <fo:block>Day care or nanny expenses</fo:block>
        </fo:list-item-body>
    </fo:list-item>

    <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()" font-size="9pt">
            <fo:block>Field trips</fo:block>
        </fo:list-item-body>
    </fo:list-item>

    <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()" font-size="9pt">
            <fo:block>School supplies</fo:block>
        </fo:list-item-body>
    </fo:list-item>

    <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()" font-size="9pt">
            <fo:block>Music lessons and other extracurricular activities</fo:block>
        </fo:list-item-body>
    </fo:list-item>

</fo:list-block>

1 个答案:

答案 0 :(得分:7)

要更改列表项之间的垂直空间,请在列表项上使用space-after(或者space-before

<fo:list-item space-after="5mm">
  <fo:list-item-label end-indent="label-end()">
     <fo:block>&#x2022;</fo:block>
  </fo:list-item-label>
  <fo:list-item-body start-indent="body-start()" font-size="9pt">
       <fo:block>Day care or nanny expenses</fo:block>
  </fo:list-item-body>
</fo:list-item>

provisional-label-separation指定list-item-label的结尾与list-item-body的开头之间的临时距离(即,它是水平距离)。请参阅http://www.w3.org/TR/xsl/#d0e12377