gpt4 book ai didi

css - ColdFusion cfdocument CSS反增量计数器

转载 作者:行者123 更新时间:2023-11-28 12:22:42 27 4
gpt4 key购买 nike

下面的 HTML/CSS 在最近的浏览器中有效,但在 CF9 的 cfdocument 中无效。有人有想法吗?

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

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

示例代码

<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>

最佳答案

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

杂货:

  1. ) 苹果
  2. ) 香蕉
  3. ) 甜瓜

<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>

关于css - ColdFusion cfdocument CSS反增量计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12096043/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com