chrome浏览器打印页面 怎样自定义页眉跟页脚???跪求啊!!T—T chrome浏览器打印页面 怎样自定义页眉跟页脚window.print();膜拜各位大神,寻求帮助啊···· 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <title> 页面名称 </title><style type="text/css">header, footer { display: none;}@media print { header { display: block; } footer { display: block; }}</style></head><body><header>页眉</header><p>内容</p><footer>页脚</footer></body></html> HTML结构<div class="wrapper"> <div class="content">内容</div> <div class="footer">页脚</div></div>CSShtml, body { height: 100%; } .wrapper { position: relative; min-height: calc(100% - 40px); //这里可以调整一下 padding-bottom: 40px; box-sizing: border-box; }.footer { position: absolute; bottom: 0; height: 40px; width: 100%; text-align: center; line-height: 40px; } 如何修改没有id的div的样式 Jquery瀑布流布局(每行代码都有详细注释) 清熟悉jQuery的朋友給推荐个图片预览的插件 问一个相当简单的问题~~ 网页中JS能否操作word,搜索到word中的关键词并加粗显示 简单表格排序问题 关于offset的问题。 xhtml到底会怎样?大家来讨论讨论吧,高手进来发表高见吧 JS文件的组成特点是什么? 找我最爱的人 各位前端大神,问一个弹窗滑动的问题!! react问题解决
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
header, footer {
display: none;
}
@media print {
header {
display: block;
}
footer {
display: block;
}
}
</style>
</head>
<body><header>页眉</header><p>内容</p><footer>页脚</footer></body>
</html>
<div class="content">内容</div>
<div class="footer">页脚</div>
</div>
CSS
html, body {
height: 100%;
}
.wrapper {
position: relative;
min-height: calc(100% - 40px); //这里可以调整一下
padding-bottom: 40px;
box-sizing: border-box;
}
.footer {
position: absolute;
bottom: 0;
height: 40px;
width: 100%;
text-align: center;
line-height: 40px;
}