0

I am trying to print 33 pages from my website but I need to add page number to each printed page using css I saw alot of solution for that like How to print page number using css , get printed page number of an element and Page numbers with CSS/HTML but nothing working for me and it's return an error in @bottom-right that ' is not a known CSS property name '

my CSS :

  <style type="text/css" >
    @media print
    {
      table.break {page-break-after: left}
    .no-print, .no-print *
   {
      display: none; 
     }
     }

  @page {
      @bottom-right {
     content: counter(page) " of " counter(pages);
    }
   }
   </style>
Community
  • 1
  • 1
rawan
  • 29
  • 8

2 Answers2

0

You need to increment page somehow, look at the examples you have posted already:

counter-increment: page;
    counter-reset: page 1;

Use pure examples, try if they work, and then try to adapt to your needs.

Further reading

Where are you getting that error?

Maciej Kwas
  • 6,169
  • 2
  • 27
  • 51
0

To me, the errors you are getting appear to be validation errors. There are components absent in the CSS 2.1 spec although being supported by all major browsers.

You could try changing your stylesheet validation to CSS3.

If you are using VS, then

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\1033\schemas\CSS\css30.xml

is where you could begin.

bit_by_bit
  • 337
  • 2
  • 14
  • This could help: http://stackoverflow.com/questions/3931801/is-it-possible-to-change-css-validation-scheme-in-vs2010 – bit_by_bit Apr 28 '15 at 10:57
  • I installed it but drop down list for the style sheet enabled – rawan Apr 28 '15 at 11:01
  • Didn't get what you meant by the drop-down part. As the link quotes, " If you can't see it right click on the menu and check Style sheet." – bit_by_bit Apr 28 '15 at 11:04
  • I found it and I select css3 put still return the same error – rawan Apr 28 '15 at 11:13
  • return this error (Validation(CSS 2.1): 'bottom-right' is not a known CSS property name – rawan Apr 28 '15 at 11:23
  • Try doing this: http://stackoverflow.com/questions/7246965/css-2-1-errors-not-a-known-property-name This would surpass the errors as if they were warnings. – bit_by_bit Apr 28 '15 at 12:46