Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

Position: static print problem

  • 13 réponses
  • 1 a ce problème
  • 73 vues
  • Dernière réponse par CharlesEF

more options

Hi All,

My web pages have 4 basic sections, Header, Menu, Content and Footer. In the print media query position static is used. I understand that should make them print in order. All browser had this messed up for many years but I'm sure Firefox had this fixed for awhile. In version 82.0.3 this is messed up again, footer prints at the top of 1st page.

Is this a printing bug? Or, do I misunderstand position static?

Why can't it print as shown on screen, What you see is what you get?


Thank you for any help,

Charles

Hi All, My web pages have 4 basic sections, Header, Menu, Content and Footer. In the print media query position static is used. I understand that should make them print in order. All browser had this messed up for many years but I'm sure Firefox had this fixed for awhile. In version 82.0.3 this is messed up again, footer prints at the top of 1st page. Is this a printing bug? Or, do I misunderstand position static? Why can't it print as shown on screen, What you see is what you get? Thank you for any help, Charles

Solution choisie

Your fieldset is floated, leaving plenty of room for your footer badges to slide up. I suggest clearing floats at the beginning of the footer by adding:

#footer { clear: both; }
Lire cette réponse dans son contexte 👍 0

Toutes les réponses (13)

more options

Have I posted in the wrong place? Over 1 week and no replies? At least tell me where to post.

Thank you,

Charles

more options

Hi All,

I have found that I do have pages that print correctly, with the footer at the bottom. So far the correctly printed pages contain table data. The pages that print incorrectly contain form data.

My footer consists of 2 sections, 1 floated left and the other floated right. When I print with both sections showing then the footer prints at the bottom, as it should. But if I hide the left section and then print the footer prints at the top.

All pages that have a footer printing problem contain nothing on the left side of the footer. I don't think form vs table data makes a difference.

Is this a bug?

more options

Hi Charles, there's a button in the Developer Tools, Page Inspector, Rules panel to flip over to viewing your site using the print style sheets. Looks like this:

Try using that to see which rules are actually in effect in print mode as there might be something with higher precedence or other conflict.

more options

CharlesEF said

My footer consists of 2 sections, 1 floated left and the other floated right. When I print with both sections showing then the footer prints at the bottom, as it should. But if I hide the left section and then print the footer prints at the top.

Possibly one of your clear:left or clear:right or clear:both rules is not getting applied when you hide the left section.

more options

Hi jscher2000,

I have used the inspector to view the print css rules. My version of FF doesn't have the word 'Rules' but I did know about the toggle button. There is nothing I can see that would cause a problem but I'm not a whiz with CSS. As for clearing floats, yes I checked my HTML and I do reset the float after both left and right sections.

Maybe it does have something to do with form vs table data. I have a 7 page report, using a table, and the left section of the footer is hidden but the footer prints correctly, at the bottom of page 7.

Thanks for your ideas,

Charles

more options

I cannot diagnose this without working with the code, sorry.

more options

Hi jscher2000,

I did think about making a sample page to show the problem. But, since a database is used to fill in the report tables I wasn't sure it would show the problem without a database. If you want to look over the HTML, JavaScript and CSS I can place the application on my website. It might take a couple of days but I can do it if you want?

Thanks,

Charles

more options

Before that, what happens if you return to the Page Inspector, turn on print emulation and then turn off the floats in the footer?

more options

When I turn off the right float then that section moves to the left. When I print preview the footer is printed on the left, at the top of the 'content' section. But, the footer images don't overlap the form data. It seems to appear after the form data fieldset. When the right float is enabled then the footer images still show at the top of the 'content' section, but on the right.

Thank you,

Charles

more options

Is the fieldset floated or positioned?

more options

Hi jscher2000,

I went ahead and placed the page we are talking about on my website, this page doesn't need a database. Please visit this page. When you do a print preview you will see the footer images print on the right at the top of the 'content' section. I can't see anything wrong with the CSS, at least not with my current understanding of CSS.


Thank you for helping,

Charles

more options

Solution choisie

Your fieldset is floated, leaving plenty of room for your footer badges to slide up. I suggest clearing floats at the beginning of the footer by adding:

#footer { clear: both; }
more options

Hi jscher2000,

Ahh, so your saying that I didn't clear the float for the fieldset itself. By adding your CSS suggestion the footer prints correctly. I might leave the CSS in, as insurance. But I will fix the HTML.

Thank you very much for your help. I never thought about the fieldset float being the problem.

Charles