how to remove header and footer in printing using javascript?

Today, We want to share with you how to remove header and footer in printing using javascript.In this post we will show you set header/footer print javascript, hear for browser print header/footer javascript we will give you demo and example for implement.In this post, we will learn about How To Add Header And Footer In PDF Page Using DOMPDF? with an example.

remove header/footer print javascript

Example 1:

@page { margin: 0; }

OR

@media print {
  @page { margin: 0; }
  body { margin: 1.6cm; }
}

Example 2:


remove header and footer while printing Example

index.html



    Print To My Web WWW.pakainfo.com
    


  
Welcome Page
Tamilrokers new link

How to Remove URL from Printing the Page ?

simplest ways

@page { 
	size: auto; 
	margin: 0; 
} 

OR

@print { 
	@page :footer { 
		display: none
	} 

	@page :header { 
		display: none
	} 
} 
@media print { 
	@page { 
		margin-top: 0; 
		margin-bottom: 0; 
	} 
	body { 
		padding-top: 72px; 
		padding-bottom: 72px ; 
	} 
} 

I hope you get an idea about remove the default browser header and footer when printing html.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment