html - 当我打印 HTML 字体很小

标签 html css internet-explorer printing browser

我正在尝试为我的网页创建一个 print.css。

无论我将字体设置多大,页面都会缩小以适合。如果我在打印预览中将其设为 100%,它会裁掉一半页面。

我看过这里http://windows.microsoft.com/en-us/windows/printing-webpages-faq#1TC=windows-7它并没有真正的帮助。

所以我想我想知道的是如何不使用字体比例,而是让它保持我说的大小并适本地换行。

这是我的 print.css

@media print {
* { margin: 0 !important; padding: 0 !important; }

html, body {
    font-family: Georgia, serif  !important;
    font-size: 12pt !important;
    background: none;
    color: black;
}

img {
    max-width: 100% !important;
}

ul, img {
    page-break-inside: avoid;
}

a {
    display: none !important;
}

.visible-print {
    display: inherit !important;
}

.hidden-print {
    display: none !important;
}

/* THIS IS AWFUL */
.mainContent .span3.content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
}

.profiler-results {
    display: none !important;
}
}

@media print and (color) {
* {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
}

@media screen {
.hidden-screen {
    display: none !important;
}
}

最佳答案

我猜你可能想将 12pt 更改为 12px(或大于 12)

关于html - 当我打印 HTML 字体很小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22447440/

相关文章:

css - 显示 :none to image if class

html - 表格不显示边框

php - 如果启用了 javascript,则阻止 php 执行

html - 如何让两张图片同时响应

html - 使用 CSS 在末尾带有短斜线的文本下划线

internet-explorer - 在 Visual Basic 中将焦点设置为 Internet Explorer 对象

vba - 将 Internet Explorer 窗口置于前台

html - Firefox 显示背景图片为黑色

css - 为什么我的列不能正确对齐?

security - 当IE提示 “Only secure content is displayed”时,我能知道不安全内容的网址吗?