jQuery: The Write Less, Do More JavaScript Library

CSS3 content attribute for page

View: New views
3 Messages — Rating Filter:   Alert me  

CSS3 content attribute for page

by Mazi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo all.
I'm using CSS3 for pagination in print mode

@page {
        @bottom-center { content: "Page " counter(page) " of " counter
(pages); }
}

This works fine but I would like to extract the text content from the
css and put it in a div in the html page: something like this:

<div id="footer" style="">  Page <span id="pagenumber"/> of <span
id="pagecount"/> </div>

So in my css I changed the @page directive in this way

@page {
        @top-center { content: #footer; }
}

#pagenumber:before {
        content: counter(page);
}

#pagecount:before {
        content: counter(pages);
}

The before works fine but I cannot position the div id="footer" the
the top-center of the page.

Where is the problem?

Kind regards

Massimo



Re: CSS3 content attribute for page

by Scott Sauyet-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 10, 1:00 pm, "m.ugues" <m.ug...@...> wrote:
> I'm using CSS3 for pagination in print mode
> [ ... ]
> The before works fine but I cannot position the div id="footer" the
> the top-center of the page.

This doesn't seem to have anything to do with jQuery.  Are you looking
for a jQuery solution to your CSS problem?

There's a great css discussion list at http://www.css-discuss.org/

  -- Scott

Re: CSS3 content attribute for page

by Mazi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you Scott, I was searching for a CSS discussion.
Sorry for the OT. :)

Massimo

On 10 Nov, 20:01, Scott Sauyet <scott.sau...@...> wrote:

> On Nov 10, 1:00 pm, "m.ugues" <m.ug...@...> wrote:
>
> > I'm using CSS3 for pagination in print mode
> > [ ... ]
> > The before works fine but I cannot position the div id="footer" the
> > the top-center of the page.
>
> This doesn't seem to have anything to do with jQuery.  Are you looking
> for a jQuery solution to your CSS problem?
>
> There's a great css discussion list athttp://www.css-discuss.org/
>
>   -- Scott