
在线文档打印指引
通过浏览器 AddCSS 插件可以优化在线文档打印效果。
Microsoft Learn
@media print {
.box {
box-shadow: unset;
}
.section {
padding: unset;
}
div.alert.top-alert.is-hidden-portrait, div.modular-content-container.has-margin-top-medium.has-margin-bottom-medium, div.footerContainer, #interactive-container, #next-section, ul.metadata.page-metadata,
nav.pagination, div.xp-tag {
display: none;
}
.table td, .table th {
border-top: 1px solid hsla(0,0%,89%,1);
}
div.codeHeader {
display: none;
}
div.codeHeader + pre {
border: 1px solid hsla(0,0%,89%,1);
background-color: hsla(0,0%,98%,1);
margin-top: 16px;
}
.alert.is-success {
background-color: hsla(120,77%,90%,1);
border: 1px solid hsla(120,77%,90%,.999);
}
.alert {
color: hsla(206,100%,15%,1);
}
.alert.is-primary {
background-color: hsla(205,100%,94%,1);
border: 1px solid hsla(205,100%,94%,.999);
}
}
Visual Studio Code
需要手动选择打印部分
@media print {
h1 {
font-size: 36px;
}
h2 {
font-size: 28px;
}
h3 {
font-size: 20px;
}
blockquote {
border-top: none;
border-right: none;
border-bottom: none;
font-size: 16px;
}
div.body-content {
padding-top: 0;
}
div.body-footer,
div.feedback,
footer,
div.navbar-fixed-container,
div.updates-banner,
div.docs-navbar-container,
div.edit-github,
div.docs-subnavbar-container {
display: none;
}
}