我想在A4纸上打印部分页面,我希望段落从顶部到下面几英寸和段落之间的1英寸排列..请帮我用HTML和CSS代码来实现相同的目标
答案 0 :(得分:0)
在你的页面上有这样的东西,因为在浏览器之间打印差异,它永远不会是eaxact,但会足够接近。要获得更准确的结果,请创建一个css打印文件Info here
app.post('/feeds',function(req,res) {
var _id = req.body._id;
var title = req.body.title;
var description = req.body.description;
var latitude = req.body.latitude;
var longitude = req.body.longitude;
db.user.update(
{_id:_id },
{$push : {
feeds:[{
title: title,
description: description,
latitude:latitude,
longitude:longitude
}]
}
}
,function (err,result) {
console.log(err);
if (err) {
res.json({"success": '0', "message": "Error adding data"});
}
else {
res.json({"success": '1', "message": "Data added"});
}
});
});
答案 1 :(得分:0)
答案 2 :(得分:0)
您可以以英寸使用margin-top,margin-bottom样式来实现此目的。
<body>
<p>
Sample Paragraph Text1
</p>
<p>
Sample Paragraph Text2
</p>
<p>
Sample Paragraph Text3
</p>
<body>
<style>
p {
margin-bottom:1in;
}
body {
margin-top: 1in;
}
</style>
答案 3 :(得分:0)
@media print { /* for print only css for `p` or any other element */
p {
margin: 1in /* or any other unit */
}
}
用于页面级打印样式
@page {
margin: 1in; /* or any other unit */
}
对于页面侧特定样式
@page :left {
margin: 1in;
}
@page :top {
margin: 1in;
}
@page :bottom {
margin: 1in;
}
@page :right {
margin: 1in;
}