简体   繁体   English

通过CSS更改打印页面标题字体大小

[英]Change print page title font size by CSS

Is it possible to change font size of header(Page title) and footer(Page URL and Pagination) print by browser in print by CSS? 是否可以在CSS打印中更改浏览器打印的页眉(页面标题)和页脚(页面URL和分页)的字体大小?

Actually I've a big title in my page. 实际上,我的页面上有个大标题。 But i want to display it completely by reducing it's size. 但是我想通过减小其尺寸来完全显示它。

Is there any way to reduce font-size of title as we can set other property of page ie. 有什么办法可以减小标题的字体大小,因为我们可以设置页面的其他属性。

@page {
  margin-top: 2cm;
  margin-bottom: 2cm; 
  margin-left: 3cm; 
  margin-right: 3cm;
}

you can try this: 您可以尝试以下方法:

@media print {
    h1 {
        font-size: 12pt;
    }
}

Otherwise you can checkout this tutorial for more information on CSS media: http://www.tutorialrepublic.com/css-tutorial/css-media-types.php 否则,您可以查看本教程以获取有关CSS媒体的更多信息: http : //www.tutorialrepublic.com/css-tutorial/css-media-types.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM