Categories
CSS

How to remove page title and date when printing web page with CSS?

Spread the love

Sometimes, we want to remove page title and date when printing web page with CSS.

In this article, we’ll look at how to remove page title and date when printing web page with CSS.

How to remove page title and date when printing web page with CSS?

To remove page title and date when printing web page with CSS, we can use the @page rule.

For instance, we write

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

to set the margin to 0mm to hide the page title.

The title is printed at the margin so setting the margin to 0mm would hide the title.

Conclusion

To remove page title and date when printing web page with CSS, we can use the @page rule.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.