Forum How do I...?

place a fixed element on every page

moormann
Is it possible to place an item (a div containing two images and some text) on every page without changing the margin and not knowing how many pages are going to be generated?
Currently I use
    .logo {
        float: right;
        font-size: 7pt;
        position: fixed;
        top: 25mm;
        right: -5mm;
    }

to place the div. It's about 40mm wide.

Thanks in advance
mikeday
Can you flow it to a page margin box, then make it absolutely positioned? eg.
@page {
    @top { content: flow(header) }
}

.logo {
    flow: static(header);
    position: absolute;
    ...
}
moormann
unfortunately this doesn't work. I've created a test for this. I've also tried to use fixed etc. But it seems as if you put something in the top area it stays there beeing caged :)

http://pastebin.com/r3BFXBEn

Thanks
dauwhe
You could also try a background image on @page.
moormann
I need the text to be selectable and I don't see any possiblity to add a div to the background or am I missing something?
mikeday
Here is a solution: instead of making the .logo div position: absolute, instead put another div inside the logo div and position that:
<div class="logo">
<div style="position: absolute">
...
</div>
</div>
moormann
Thanks a lot for your time. Again I'm very happy to use your software :)