如何应用CSS进行打印? [英] How can i apply CSS to print?
本文介绍了如何应用CSS进行打印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在我的页面之一中打印div,但是在打印时我无法应用CSS.在样式标签中写入media ="print"无效.我该怎么办?
I am trying to print a div in one of my pages but i can't apply css when printing. Writing media="print" inside of the style tags doesn't work. What should i do?
<style type="text/css" media="print">
body
{
font-size:medium;
color:Black;
font-size:14px;
}
input
{
margin:0px;
font-size:14px;
}
.grid
{
border-color:Gray;
border-width:1px;
}
.alan
{
border-style:none;
}
.grid1
{
border-color:Gray;
border-width:1px;
}
</style>
推荐答案
使用以下内容:
<style type="text/css">
@media print
{
body {
/* styles */
}
}
</style>
这篇关于如何应用CSS进行打印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文