Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to get a header and footer on HTML?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24947
    ppuniversal
    Member

    Hi,
    I have an assignment in which I generate an Application Form for Print purposes. The information(thus number of pages) on the Application Form varies from user to user. So sometimes, the Application print is 1 page long, sometimes 2 pages and sometimes even more.

    Now my client is asking me to put a standard header and footer on the page, which should get printed with each page. For example, if the print of the Application Form is coming 1 page long, there would be 1 header and 1 footer.
    If it is coming out to be more that 1 page long, then there should be 1 header and 1 footer on each page which is printed.

    I tried few approaches (using simple HTML), but failed.

    Please let me know if there is any way to accomplish this task.

    Pawan Pillai
    India

    #58284
    AshtonSanders
    Participant

    I have not personally done this or tested it, but I imagine with some testing you could work this out:

    If you have an image that is the height of the printed page, you can repeat-y that as a background image

    Code:
    body {background: url(‘image/location.gif’) repeat-y top center}

    That should repeat on the vertical access and be at the top of every page… as a background image.

    (What is the height of a page to a printer?… yea that’s what needs to be figured out… is there a set height for all browsers?… more testing or maybe Google?)

    That’s what I would try.

    #58300
    Chris Coyier
    Keymaster

    Could this be used with the tags page-break-before and page-break-after perhaps? I’ve not worked with print type CSS before so haven’t really looked at those elements…

    #58320
    ppuniversal
    Member
    "AshtonSanders" wrote:
    I have not personally done this or tested it, but I imagine with some testing you could work this out:

    If you have an image that is the height of the printed page, you can repeat-y that as a background image

    Code:
    body {background: url(‘image/location.gif’) repeat-y top center}

    That should repeat on the vertical access and be at the top of every page… as a background image.

    (What is the height of a page to a printer?… yea that’s what needs to be figured out… is there a set height for all browsers?… more testing or maybe Google?)

    That’s what I would try.

    Thanks Ashton,
    Looks like a logical solution. I will try this.
    Only problem could be the print page length.

    Thanks
    Pawan Pillai

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.