Forum How do I...?

Font in Generated Content

captzulu
I am trying to make what would be equivalent to the chapter name in a book appearing at the top of pages.

The problem is whether I'm using
flow :static(pageName);
or
string-set: pageName content();
I can't seem to change the font of it.

Here is the relevant css :
 h3.pageName { 
    prince-bookmark-level: none;
    //string-set: pageName content(); 
    flow :static(pageName);
    //visibility: hidden;
    font-size:15px;
    font-family: 'Arial Narrow',Arial,"Times New Roman" !important;
    font-weight:bold;
}


@page @top-right{
        //content: string(pageName);
        content: flow(pageName);
        font-size:15px;
        font-family: 'Arial Narrow',Arial,"Times New Roman" !important;
        font-weight:bold;
    }


Is there a way to do this?

Edited by captzulu

mikeday
Either of these should work fine, try the example HTML attached below.
  1. content.html0.2 kB
  2. flow.html0.2 kB
captzulu
Ok this is a weird one :

I have this line
body {font-family: "Arial Narrow", Arial, sans-serif;}
which should apply to the whole document unless overwritten.

I also had this
 h3.pageName {font-family: 'Arial Narrow',Arial,"Times New Roman" !important;}
on the element itself which should have just overwritten the body font-family but instead made the .pageName revert to Times New Roman which is the default serif font.

I made some tests and this is what i found :
  • Commenting the font-family line in the .pageName block made it change to Arial Narrow in the page ONLY not in the @top-right part.
  • Removing the "Times New Roman" part from the font-family line didnt change anything.
  • The font-family line in the @top-right block doesnt do anything and thus when using string-set method I am still unable to achieve the correct font (stuck on Times New Roman)
  • Using the Flow method works when the font-family line is removed from the .pageName block

Conclusion is there seems to be some problem with overwriting css. I managed to make it work though thx!
mikeday
Using font-family on body will not affect the page margin boxes unless they contain content taken from the document, which does inherit properties from the document.