ColdFusion cfdocument CSS反增量计数器

时间:2012-08-23 16:19:31

标签: css coldfusion cfdocument

下面的HTML / CSS适用于最近的浏览器,但不适用于CF9的cfdocument。有想法的人吗?

我知道什么? 是!我知道CF的cfdocument支持一组有限的CSS属性。 CF文档说支持计数器重置,计数器增量和计数器。

预期输出
杂货:
  1)苹果
  2)香蕉
  3)Cantelopes

示例代码

<cfdocument format="PDF" pagetype="letter" 
    margintop="0.5" marginbottom="0.5" 
    marginleft="0.5" marginright="0.5">
<html>
<head>
    <style type="text/css">
        li { list-style-type: none; }
        ol { counter-reset: ordered; 
          padding-left: 0.5em; 
          border: solid 1px #F00; 
        }
        li:before { counter-increment: ordered; 
          content: counter(ordered) ") "; 
        }
    </style>
</head>
<body>
    <strong>GROCERIES:</strong><br>
    <ol>
      <li>Apples</li>
      <li>Bananas</li>
      <li>Cantelopes</li>
    </ol>
</body>
</html>
</cfdocument>

1 个答案:

答案 0 :(得分:1)

我认为指定list-style-type可能有所帮助,下面的内容应该会让你更接近。它在数字后面有小数点:

杂货:

  1. )苹果
  2. )香蕉
  3. )Cantelopes

  4. <cfdocument format="PDF" pagetype="letter" 
        margintop="0.5" marginbottom="0.5" 
        marginleft="0.5" marginright="0.5">
    <html>
    <head>
        <style type="text/css">
            ol {list-style-type: none;}
            li:before {content: counter(section, decimal) ") ";}
            li { counter-increment: section;}
        </style>
    </head>
    <body>
        <strong>GROCERIES:</strong><br>
        <ol>
            <li>Apples</li>
            <li>Bananas</li>
            <li>Cantelopes</li>
        </ol>
    </body>
    </html>
    </cfdocument>
    
相关问题