ColdFusion cfdocument CSS计数器增量计数器
下面的HTML/CSS可以在最新的浏览器中使用,但不能在CF9的CFC文档中使用。有人有想法吗 我知道什么? 对我知道CF的cfdocument支持一组有限的CSS属性。 CF文档说明支持计数器重置、计数器增量和计数器 预期产出ColdFusion cfdocument CSS计数器增量计数器,css,coldfusion,cfdocument,Css,Coldfusion,Cfdocument,下面的HTML/CSS可以在最新的浏览器中使用,但不能在CF9的CFC文档中使用。有人有想法吗 我知道什么? 对我知道CF的cfdocument支持一组有限的CSS属性。 CF文档说明支持计数器重置、计数器增量和计数器 预期产出 杂货: 1) 苹果 2) 香蕉 3) 悬臂梁 示例代码 <cfdocument format="PDF" pagetype="letter" margintop="0.5" marginbottom="0.5" marginleft="0.5"
杂货:
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>
li{列表样式类型:无;}
ol{计数器复位:有序;
左侧填充:0.5em;
边框:实心1px#F00;
}
li:在{计数器增量:已排序;
内容:柜台(订购)“)”;
}
食品杂货:
苹果
香蕉
悬臂
我认为指定列表样式类型可能会有所帮助,下面的内容会让您更接近。数字后有小数点:
食品杂货:
ol{列表样式类型:无;}
李:在{content:counter(section,decimal)“)”;}
li{计数器增量:节;}
食品杂货:
苹果
香蕉
悬臂
+1阅读支持的属性列表:)参考:cfdocument支持的CSS属性谢谢Tim。我已经用过你的例子了。我没有意识到我的CSS不正确。这看起来像是li:before按预期在CFC文档中工作。没有出现的是柜台。啊!FWIW,我得到了和Tim一样的结果。你使用了上面的代码吗?你在运行什么版本的CF?以下是我关于计数器不出现的意思。如果替换行:content:counter(ordered)“)”;内容如下:“X”计数器(已订购)“;你会明白我的意思。顺便说一句:我在运行CF9,收到了与Tim相同的结果。
<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>