Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to hide the breadcrumb and footer when printing the page? #258

Closed
hkchakladar opened this issue Aug 9, 2023 · 1 comment
Closed

Comments

@hkchakladar
Copy link

When print the page (Ctrl + P), the breadcrumb and footer is visible in the page. I want to remove these when printing.

Tried this CSS, but it's not working. Still breadcrumb and footer is not hidden. Other elements are hidden :

@media print {
        body * {
            visibility: hidden; /* // part to hide at the time of print */
        }

        .breadcrumb {
          display: none !important; /* //this is not working */
        }

        footer {
          display: none !important; /* //this is not working */
        }

        .app-footer {
          display: none !important; /* //this is not working */
        }

        #printable * {
            visibility: visible !important; /* // Print only required part */
            text-align: left;
            -webkit-print-color-adjust: exact !important;
        }
    }```
@InoueKenta
Copy link

work fine for me.

<style>
@media print {
  .breadcrumb {
    display: none !important;
  }
}
</style>

don't use style scoped on media print css. It won't work like that.

bootstrap already had a display none on print class. you can utilize that class to save time
https://getbootstrap.com/docs/5.0/utilities/display/#display-in-print

@mrholek mrholek closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants