When printing, the footer information appears jumbled together

When creating a footer for printing, I am utilizing the following CSS:

@media all {
   .page-break  { display: none; }
   .footer {display: none; }    
}

@media print {
   .page-break  { display: block; page-break-before: always; }
  .footer {display: block; position: fixed; bottom: 0; text-align: center; width:100%;}  
}

Within the HTML, the structure resembles something like this:

<body>
  ...
  ...
 <div class='footer'>Page Number: 1</div>
 <div class='page-break'></div>
 ...
 ...
 <div class='footer'>Page Number: 2</div>
 <div class='page-break'></div>
 ...

</body>

An issue arises in the printed view where the footers for page 1 and page 2 overlap. This is due to the CSS property "position: fixed; bottom 0". To resolve this, my question is how can I ensure that the footers for page 1 and page 2 appear at the bottom of their respective pages in print view without overlapping?

Thank you.

Answer №1

Consider moving one of them off-center to create a more dynamic look.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to customize the appearance of individual sections in an HTML5 range slider by changing their

I'm looking to customize a stepped HTML5 range slider by changing the background color for each step, similar to the image provided. Is this customization achievable? ...

Is there a way to customize my visual studio code to automatically insert an indented space between curly brackets in CSS when I press enter?

Whenever I try to open curly brackets in CSS and press enter, it simply moves to the next line without adding an indentation as shown below: body { } Despite going through the settings and experimenting with different options, I haven't been able to ...

AngularJS telephone input

In my opinion, AngularJS does not properly respond to input[type=tel]. There is a lack of online documentation regarding this issue. I have tried using ng-model, ng-value, and value but none of them seem to work. -- Has anyone figured out how to input ...

Arrangement of SVGs within one another

I am working on achieving a layout with multiple SVG elements arranged in a specific way. This layout involves a top-level gray box containing several orange boxes, each of which holds red boxes. The width and height of the top-level SVG are known. https: ...

Pass the ID of the <a> element from one function to another

I am a beginner in javascript/jQuery, so please be patient with me if my question seems too simple for you and too challenging for me. I have a function that I won't post the entire code for because it would make this too lengthy. Another function ...

Resolving the "TypeError: $ is not a function" issue on a custom WordPress page

I developed a unique WordPress page using a custom plugin, where I aim to switch comments on and off with the following code: <script type="text/javascript> $("comment_switch").click(function () { $("comments").toggleClass("hidden"); }); < ...

Issues with displaying nested HTML tables properly

Struggling to set up a system for Parent and Child rows in an HTML table. While the code is somewhat functional, my lack of JavaScript knowledge is causing issues with selecting elements correctly. When I click on the first parent row, only one child row a ...

Designing the Irish flag solely with HTML and CSS: a step-by-step guide

I have successfully created the Indian flag using HTML and CSS, with the exception of the Ashok Chakra. Now, I am looking to create the Irish flag which features a vertical tricolor design, unlike the horizontal tricolor layout of the Indian flag. Can anyo ...

What is the best way to make text span across multiple columns in a table?

Spanning column text across 3 columns of a grid (table) is my current challenge. I want the text to begin in the 3rd column and wrap around to the end of the 5th column. I successfully managed to span it by applying a CSS style to the 3rd column's cl ...

Steps for Including a Required AMP HTML Attribute in an HTML Tag

Currently working on my website with Gatsby and would like to classify it as an AMP website. What's the best way to include the required AMP attribute in the <html> tag? ...

Owl carousel experiencing issues with navigating to the previous and next slides

I've been struggling to get the owl carousel slider working properly, specifically the previous and next buttons. Here is a snippet of my code: <div class="magazine-carousel owl-theme"> <div class="item"></div> <div class="item" ...

Identifying the Operating System and Applying the Appropriate Stylesheet

I am trying to detect the Windows operating system and assign a specific stylesheet for Windows only. Below is the code snippet I have been using: $(function() { if (navigator.appVersion.indexOf("Win")!=-1) { $(document ...

Scroll the div back to the top when the form is submitted

I have set up a form in a pop-up using Bootstrap modal. The form is quite long, so after submission, the message appears at the top of the form. However, I want it to scroll to the top when the user submits the form so they can easily see the message. Is ...

Connecting HTML Attributes to an XML Data Source

I have limited familiarity with the SGML family, but I need to create a small website for an application installation process. This website will display the selected features permanently. Thanks to Bootstrap, the website looks great. However, I now want to ...

Retrieving inner text using HTML Agility Pack

I need assistance with parsing a website I have found here: https://i.sstatic.net/GdFN1.png My goal is to extract information from specific fields that have IDs and classnames: label = node.SelectSingleNode( ".//h3[@c ...

Bootstrap popover fails to function without any visible errors

Currently in the process of developing a website with the latest version of Bootstrap, I'm looking to implement a feature where a popover appears upon clicking a specific button. After including the necessary jQuery and popper.js files in my project, ...

Expandable menu using jQuery

Currently, I am experimenting with an Accordion Menu plugin called example 3: Non-accordion (standard expandable menu). My goal is to set up a menu structure where there are 5 options. Two of these options have sub-menus, while the other three are direct ...

Embed numerous HTML pages within a designated DIV by utilizing a list of hyperlinks

I'm currently facing an issue and can't seem to figure out the solution. I am looking for a way to achieve this without using PHP or JAVA as I am not proficient in those languages yet. The scenario is that I have 18 products/links and a single d ...

Dropdown menu in Bootstrap gets cropped behind a scrollable container

I am encountering a problem with my Bootstrap Drop Down. The dropdown is located within a scrollable div with a fixed height. Whenever I click on the dropdown, the menu appears behind the scroll content. However, a normal select works perfectly fine. htt ...

The bootstrap 4 dropdown button fails to activate the dropdown feature

I am currently working on a Flask application with Bootstrap integration. I am facing an issue while trying to incorporate a dropdown menu, which needs jQuery + Popper elements in order to work properly. Even though the button is displayed, the dropdown fu ...