CSS 强制分页应用,求救!!!

deng11342 2011-10-12 11:20:35

@page {
size: 4.18in 6.88in;
margin: 0.25in;
-fs-flow-top: "header";
-fs-flow-bottom: "footer";
border: thin solid black;
padding: 1em;
}

#header {
font: bold serif;
position: absolute; top: 0; left: 0;
-fs-move-to-flow: "header";
}

#footer {
font-size: 90%; font-style: italic;
position: absolute; top: 0; left: 0;
-fs-move-to-flow: "footer";
}



这个CSS 将HTML 强制分页功能,
-fs-flow-top 定义页眉,
-fs-move-to-flow 将层移动到 相对应的 位置,
求 定义规则解释,, 这定义能看懂 但不能模仿。。

...全文
234 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
deng11342 2011-10-12
  • 打赏
  • 举报
回复
呵呵,自己找到了替代方法。。
贴上:

@page {
size: 4.18in 6.88in;
margin: 0.25in;
border: thin solid black;
padding: 1em;
@bottom-center{
content:"@xxoo有限公司 版权所有";
font-family: SimSun;
font-size: 9px;
color:red;
};
@top-center { content: element(header) };
@bottom-right{
content:"page " counter(page) " of " counter(pages);
font-family: SimSun;
font-size: 9px;
color:red;
};
}

div#myheader {
display: block;
position: running(header);
}


第一种方案是 过时的写法,
贴上的为 现在的写法
-fs-flow-top 定义页眉 替换为 @top-center { content: element(header) }; 意思是在分页的时候 在 top 位置用 content 添加一个 header 元素, 然后将 层 runing 到 header 元素处。


61,117

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧