首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ColdFusion cfdocument CSS计数器

ColdFusion cfdocument CSS计数器
EN

Stack Overflow用户
提问于 2012-08-23 16:19:30
回答 1查看 441关注 0票数 2

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

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

预期输出

杂货:

1)苹果

2)香蕉

3)加拿大羚羊

示例代码

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2012-08-23 21:11:42

我认为它可能有助于指定列表样式类型,这将使您更接近。它在数字之后有小数点:

杂货:

  1. )苹果
  2. )香蕉
  3. )加拿大羚羊

代码语言:javascript
复制
<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>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12096043

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档