CSS @media print counter(page) issue

Torjescu Sergiu

I have an issue regarding the content: counter(page) in my media print. The counter of the page disappears if the margin is set to 0:

  @page {
    counter-reset: page;
    size: A4;   /* auto is the initial value */
    margin: 0;  /* this affects the margin in the printer settings */
    @top-right {content: counter(page);}
    }

On the other hand, if I do not use the margin set to 0, other elements appear on the corners of the page, such as website URL, title, and current date, which I do not want.

I was wondering if there is a way in which I can make the counter page appear after using the margin:0 or if I can hide the other 3 elements if I do not use margin 0.

Any help or advise would be appreciated!

Torjescu Sergiu

Apparently because of the fact that the print view settings are User based, there is only so much you can do regarding this matter.

Either use margin:0; and make all the 4 elements disappear (current date, website title, page counter and website URL), or use all of them as they are.

There are also some differences in browsers regarding the window.print(); command, Mozilla and Internet Explorer 11 do not have a print view and will instead download the pdf.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Css footer on media print

From Dev

CSS media query print:

From Dev

Issue with CSS media queries

From Dev

@media print issue with SVG not displaying

From Dev

CSS @media print not working at all

From Dev

CSS color property not working correctly on @media print

From Dev

@media print css not formatting table on printing

From Dev

what is the purpose of using @media and @page in media='print' css files

From Dev

Media Query CSS and Notepad++ Compatibility Issue?

From Dev

Some CSS or JS issue with Social Media Widget

From Dev

Pure CSS Social Media Icons Height Issue and Position Issue

From Dev

Using CSS print media with Xporability/css-to-pdf

From Dev

Remove CSS @media print rules without modifying CSS files

From Dev

css print media query prints only first page

From Dev

Bootstrap 3.2.0. Overwrite print media css setting for table cells

From Dev

Text is overlapping on each page (CSS @media query print)

From Dev

Bootstrap 3.2.0. Overwrite print media css setting for table cells

From Dev

Using Bootstrap, CSS Print Media Rules work on Chrome, but not Firefox

From Dev

CSS media:print include something that wasn't displayed on screen?

From Dev

I'm not finding the issue with my css @media query

From Java

Css media print show additional data, how to avoid them not come in print

From Dev

css issue in print preview. textbox values showing double

From Dev

Disable @media print in bootstrap?

From Dev

@Media Print Class in Datatable

From Dev

Social media DIV issue

From Dev

Media player seekbar issue

From Dev

Social media DIV issue

From Dev

Media Query Syntax Issue

From Dev

Wordpress media issue

Related Related

HotTag

Archive