Skip to content

Printing Friendly Styles by zigzagt

Details

Authorzigzagt

LicenseNo License

Categoryprint, printer

Created

Updated

Size2.2 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Removing annoyances like headers, footers when you print a page.

The style sheet only applies when printing (by leveraging the @media print CSS query).

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name         Printing Friendly Styles
@version      20220717.05.23
@namespace    userstyles.world/user/zigzagt
@description  Removing annoyances like headers, footers when you print a page.

The style sheet only applies when printing (by leveraging the `@media print` CSS query).
@author       zigzagt
@license      No License
==/UserStyle== */

@media print {
    header,
    footer,
    #header,
    #footer,
    #disclaimer,
    .footerwrap,
    .footerselector,
    .footwrap,
    .rightsidebar,
    .header,
    .footer,
    #disqus_thread,
    .leftbar,
    [class$="-ad"],
    .google-search-container,
    [class*="breadcrumb"],
    .AdvallyTag {
        display: none !important;
    }
    #primary, #main, #root, #page, #content, .content, .content-area {
        min-width: 80vw !important;
        flex-grow: 1 !important;
        flex-basis: 100% !important;
    }
    h1, h2, h3, h4, h5, h6,
    div, span, img, i, b, tt, p {
        orphans: 3;
        overflow:initial !important;
        box-sizing: border-box !important;
        break-after: auto;
        break-before: auto;
    }
    span, img, i, b, tt, p {
        break-inside: avoid;
    }
    h1, h2, h3, h4, h5, h6 {
        break-after: avoid-page;
    }
}


@-moz-document domain("blog.cloudflare.com") {
@media print {
    #desktop-nav-items-container, #js-mobile-nav-container {
        display: none !important;
    }
    main#post ~ * {
        display: none !important;
    }
}

}

@-moz-document domain("www.chinacourt.org") {
@media print {
    #detailheader, .address  {
        display: none !important;
    }
}

}

@-moz-document domain("www.elastic.co") {
@media print {
    #right_col, .edit_me, .console_widget {
        display: none !important;
    }
    .guide-section {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 !important;
    }
}

}

@-moz-document domain("www.toyota-4runner.org") {
@media print {
    .st_bg, .mobilenavwrapper, .hidecopytext,
    .page>table>tbody>tr>td>table,
    .page>table>tbody>tr>td>form,
    #posts~*,
    .page>table~* {
        display: none !important;
    }
}

}

Reviews

No reviews yet.