counter-increment: identifier number;
identifier 需要是 counter-reset 命名的識別字, number 則是編號遞增的數字。
舉例如下
body {
counter-reset: chapter 3;
}
h2 {
counter-reset: section;
}
h3 {
text-indent: 20px;
}
h2:before {
counter-increment: chapter;
content: "Chapter " counter(chapter) " ";
}
h3:before {
counter-increment: section;
content: "Section " counter(chapter) "." counter(section) " ";
}
/* 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:content03.css
功能:示範 CSS 2.1 樣式表的使用
作者:張凱慶
時間:西元 2011 年 7 月 */我們以下面的 HTML 文件載入
<html>
<head>
<title>網頁標題</title>
<link rel="stylesheet" type="text/css"
href="content03.css">
</head>
<body>
<h2>demo</h3>
<h2>demo</h3>
<h3>demo</h3>
<h3>demo</h3>
<h3>demo</h3>
<h2>demo</h3>
<h3>demo</h3>
<h3>demo</h3>
</body>
</html>
<!-- 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:content03.html
功能:示範 CSS 2.1 樣式表的使用
作者:張凱慶
時間:西元 2011 年 7 月 -->瀏覽器 (broswer) 開啟如下

| 中英文術語對照 | |
|---|---|
| 性質 | property |
| 元素 | element |
| 識別字 | identifier |
| 瀏覽器 | broswer |
您可以繼續參考
JavaScript 範例
自訂內容 content
引號 quotes
滑鼠游標 cursor
外框 outline
相關目錄
CSS 2.1 快速導覽
HTML, CSS 教材
首頁
參考資料
http://www.w3.org/TR/CSS21/generate.html
https://developer.mozilla.org/en/CSS/counter-increment
沒有留言:
張貼留言