473,788 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

header an footer

each web-page contains header and footer. if the web-page contains more
then one page i want to print its header and footer to each page. but
header is only printed on first page and footer on last page. how to do
this? how can i find out how many paper is needed?

Aug 2 '06
14 3051
"Garmt de Vries-Uiterweerd" <ga**********@g ooglemail.comwr ote:
>>I created a test page <http://www.phys.uu.nl/~gdevries/test/fixed/>, and
it seems that the position: fixed works fine, but the problem is that
the
fixed-positioned element overlaps the normal text

Working as designed, absolutely positioned elements are not in the flow.

Yes, that's correct. The positioning of the fixed header works the way it
should. But a header overlapping normal text is not what you want in a
practical situation, so you need a way to let the normal text begin a bit
lower, so it makes space for the header. Something like this could do the
trick:

@page { margin-top: 3cm; }
h1 { position: fixed; top: -3cm; }

But the @page rule doesn't seem to work in Opera (9.01).
The @page rule works (set a border on the body element to see),
positioning the header outside of the page box causes it to be cut off,
afaics this is allowed by the spec:

"Due to negative margin values (either on the page box or on elements)
or absolute positioning content may end up outside the page box, but
this content may be "cut" by the user agent, the printer, or ultimately,
the paper cutter."

Afaics using @page for this purpose is not appropriate, a top margin or
padding on the body wrapped in a print media rule suffices.

--
Spartanicus
Aug 3 '06 #11
(X-posted and f'ups set to ciwa.stylesheet s)

On Thu, 03 Aug 2006 12:28:14 +0200, Garmt de Vries-Uiterweerd
<ga**********@g ooglemail.comwr ote:
On Thu, 03 Aug 2006 12:11:41 +0200, Spartanicus
<in*****@invali d.invalidwrote:
>"Garmt de Vries-Uiterweerd" <ga**********@g ooglemail.comwr ote:
>>I created a test page <http://www.phys.uu.nl/~gdevries/test/fixed/>,
and
it seems that the position: fixed works fine, but the problem is that
the
fixed-positioned element overlaps the normal text

Working as designed, absolutely positioned elements are not in the flow.

Yes, that's correct. The positioning of the fixed header works the way
it should. But a header overlapping normal text is not what you want in
a practical situation, so you need a way to let the normal text begin a
bit lower, so it makes space for the header. Something like this could
do the trick:

@page { margin-top: 3cm; }
h1 { position: fixed; top: -3cm; }

But the @page rule doesn't seem to work in Opera (9.01). Unless, as I
said, I'm doing something wrong, but I don't think I am.
I did some more testing, the results of which can be seen at the URL
mentioned above. My conclusion is that a number of issues make the
solution I had in mind unusable.

1) With only the rule @page { margin-top: 5cm; }, everything works as
expected: the top margin is 5cm on all pages.

2) That same @page rule inside an @media print block is completely ignored.

3) Setting position: fixed for the header, along with top: -1cm, shows
that Opera considers everything outside the page area is cut away. I think
this violates the specs, which say:

"Due to negative margin values (either on the page box or on elements) or
absolute positioning content may end up outside the page box, but this
content may be "cut" — by the user agent, the printer, or ultimately, the
paper cutter."

The page area, together with the margin area, are part of the page box.
The specs don't say that content falling outside the page area may be cut.

--
Garmt de Vries-Uiterweerd
Aug 3 '06 #12
On Thu, 03 Aug 2006 14:46:07 +0200, Spartanicus <in*****@invali d.invalid>
wrote:

Your post and mine crossed each other. At the risk of repeating myself:
"Garmt de Vries-Uiterweerd" <ga**********@g ooglemail.comwr ote:
>Yes, that's correct. The positioning of the fixed header works the way
it
should. But a header overlapping normal text is not what you want in a
practical situation, so you need a way to let the normal text begin a
bit
lower, so it makes space for the header. Something like this could do
the
trick:

@page { margin-top: 3cm; }
h1 { position: fixed; top: -3cm; }

But the @page rule doesn't seem to work in Opera (9.01).

The @page rule works (set a border on the body element to see),
positioning the header outside of the page box causes it to be cut off,
afaics this is allowed by the spec:

"Due to negative margin values (either on the page box or on elements)
or absolute positioning content may end up outside the page box, but
this content may be "cut" by the user agent, the printer, or ultimately,
the paper cutter."
This quote refers to the *page box*, not the *page area*. The margin
specified inside an @page rule is the distance between the border of the
page area and the page box. The document is contained in the page area.
Content that falls outside the page box may be cut, according to the
specs, but nothing is said about content falling outside the page area.
Afaics using @page for this purpose is not appropriate, a top margin or
padding on the body wrapped in a print media rule suffices.
A top margin or padding only apply to the first page, so they won't help
on the next pages (see
http://www.phys.uu.nl/~gdevries/test/fixed/test5.html).
--
Garmt de Vries-Uiterweerd
Aug 3 '06 #13
"Garmt de Vries-Uiterweerd" <ga**********@g ooglemail.comwr ote:
>"Due to negative margin values (either on the page box or on elements)
or absolute positioning content may end up outside the page box, but
this content may be "cut" by the user agent, the printer, or ultimately,
the paper cutter."

This quote refers to the *page box*, not the *page area*. The margin
specified inside an @page rule is the distance between the border of the
page area and the page box. The document is contained in the page area.
Content that falls outside the page box may be cut, according to the
specs, but nothing is said about content falling outside the page area.
You're right. Moz exhibits the same behaviour btw.
>Afaics using @page for this purpose is not appropriate, a top margin or
padding on the body wrapped in a print media rule suffices.

A top margin or padding only apply to the first page, so they won't help
on the next pages
My mistake.

--
Spartanicus
Aug 3 '06 #14
On Thu, 03 Aug 2006 15:25:57 +0200, Spartanicus <in*****@invali d.invalid>
wrote:
"Garmt de Vries-Uiterweerd" <ga**********@g ooglemail.comwr ote:
>>"Due to negative margin values (either on the page box or on elements)
or absolute positioning content may end up outside the page box, but
this content may be "cut" by the user agent, the printer, or
ultimately,
the paper cutter."

This quote refers to the *page box*, not the *page area*. The margin
specified inside an @page rule is the distance between the border of the
page area and the page box. The document is contained in the page area.
Content that falls outside the page box may be cut, according to the
specs, but nothing is said about content falling outside the page area.

You're right. Moz exhibits the same behaviour btw.
Apart from the fact that my FF 1.5 doesn't apply the @page rule at all.
>>Afaics using @page for this purpose is not appropriate, a top margin or
padding on the body wrapped in a print media rule suffices.

A top margin or padding only apply to the first page, so they won't help
on the next pages

My mistake.
No worries. This is complicated stuff :)
--
Garmt de Vries-Uiterweerd
Aug 3 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12422
by: Shiz | last post by:
I currently have a Form with Option buttons (to give you the option of sorting by name, or by Field, etc), these are referenced in a module which then formats the report contingent on the option chosen (i.e. the title changes to say "Sorted by Name" or "Sorted by Field"). For one of the options, "Sort by Field" I would not only like to have them sorted by Field alphabetically, but I would like to Group them and have a Group Header and...
3
1945
by: John Crowley | last post by:
I keep running into this over and over again... I want a block server control that renders a header and footer, and child controls in between. But I don't want a templated control, for the following reasons: 1) Render blocks are not allowed inside a templated control. 2) I want the inner controls scoped at the parent aspx (or ascx), not at the template naming container. This type of control would be ideal for website headers and...
2
9272
by: LilBuh | last post by:
hi there :) i ve been looking for some time a way to print an html file from vb.net i came up with this code for printing and removing the header and footer from IE then once the printing is done restore the original header and footer Imports Microsoft.Win32 Private WithEvents myprocess As Process Private OldHeader As String
0
1914
by: LilBuh | last post by:
Hello :) this is a repost... i ve been looking for a way since last week ... i have a template html file that i modify from my code... i need to print this file without IE's Header and Footer or any print dialog then once the printing's done... restore the original Header and footer but here's what happens: - save the current header and footer
7
9519
by: Neil Jarman | last post by:
Hi, I would like to allow users to print a page, but I want to suppress the header and footer that appear by default. I gather its done with a style sheet. Please advise. Many Thanks,
7
8731
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will remain the same. I am interested to know your opinions/suggestions in finding an easy way of doing it. In asp one could have something like this:
11
16585
by: Grischa Brockhaus | last post by:
Hi, I'm trying to produce a div layout containing a header on the top with fixed height, a footer on the bottom using fixed height and a content layer using what's left of the browsers window. So my header div is defined at top:0; height:40px , my footer is defined as bottom:0; height:40px and the content is defined as top:40px;bottom:40px; This works very well with firefox but doesn't work with IE, as IE ignores the bottom statement...
0
2543
by: srk | last post by:
hi to all, i need some help , my problem is that i have to generate a word document withe the data from data base and it should be displayed as tables in word and i have to insert some header and footer in word along with the page number. i got the code for generating tables and it is fine now i am trying for header and footer but i am failing here. i am sending my code , just check it. StringBuilder sbTop = new StringBuilder();
1
2723
by: KoosHopeloos | last post by:
L.S., I'm trying to make a layout which is completely fixed in width and height if needed by using three divs rows (header, content, footer) which have each 3 div again to be able to play around better with the webdesign. The problem is that I need the content div row to nudge up automatically to the header div row, independantly of the header height. The same goes for the footer/content div row.
3
5522
by: Noorain | last post by:
I designed a site. i want to header,footer,left & right column fixed but body information only scrolling. this site screen to be 800/600 px. i designed this way but when i used position fixed all information to show as displace. please help me. my coding are as below: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.