Home > Software design >  How to hide the navbar on page print (bootstrap 5)?
How to hide the navbar on page print (bootstrap 5)?

Time:07-09

I am trying to print the page body, but the vertical "navbar" still shows up and covers a part of it.

This is the code i am using to hide the navbar on print:

@@media print and (min-width: 800px){
            #print {
                display: none;
            }
        }

This is the navbar loaded on _Layout.cshtml, as a partial view:

<partial name="_MenuSidebarVerticalPartial"  id="print" />

CodePudding user response:

You could use the class .d-print-none.

  • Related