Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8056689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:47:33+00:00 2026-06-05T08:47:33+00:00

When printing (or, in general, displaying document on paged media), is it possible to

  • 0

When printing (or, in general, displaying document on paged media), is it possible to reflow document elements so that when some element (eg. image) is shifted to next page because it doesn’t fit in available space on actual page, elements following it will be moved to remaining space of actual page?

I am trying to achieve effect similar to (or same as) LaTeX Floats, but using only CSS.

To illustrate it, let’s say we have this situation:

Page 1  | Paragraph A (...)   |
        | Paragraph B (...)   |
        |  _________________  |
        | | Top of image A  | |
        |_|_________________|_|

         ---- page break -----
         _____________________
Page 2  | | Rest of image A | |
        | |_________________| |
        |                     |
        | Paragraph C (...)   |
        | Paragraph D (...)   |
        |         ...         |
        |_____________________|

Using some basic CSS (see this question), there’s no problem achieving this:

Page 1  | Paragraph A (...)   |
        | Paragraph B (...)   |
        |                     |
        |                     |
        |_____________________|

         ---- page break -----
         _____________________
Page 2  |  _________________  |
        | | Image A (whole) | |
        | |                 | |
        | |_________________| |
        |                     |
        | Paragraph C (...)   |
        | Paragraph D (...)   |
        |         ...         |
        |_____________________|

But whan I really need is something like this:

Page 1  | Paragraph A (...)   |
        | Paragraph B (...)   |
        | Paragraph C (...)   |
        | Paragraph D (...)   |
        |_____________________|

         ---- page break -----
         _____________________
Page 2  |  _________________  |
        | | Image A (whole) | |
        | |                 | |
        | |_________________| |
        |         ...         |
        |_____________________|

So, basically, I just want to fill up all the remaining space that’s left on actual page with elements following image A (of course, only if they fit into it).

I am making some CSS3 research and want to see if Office editors can be fully replaced by CSS styling, so I don’t need the solution to be yet supported (ie. implemented in some browser at this time). All I want to know is whether it’s covered in any CSS module or construct (even if it’s just working draft), so I can assume browsers will support it in the future.

I have already searched for this in

  • CSS3 Paged Media,
  • CSS3 Regions and
  • CSS3 Generated Content for Paged Media

specifications and found nothing, but there’s still a chance I have simply overlooked something (or didn’t understand it at all), so after two days of Googling I assume it’s time to ask here 🙂


EDIT: just to make it clear, once again: I don’t need the solution to be supported in any browser now, I need to know if there’s a standard or specification that allows this (and if yes, how).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:47:34+00:00Added an answer on June 5, 2026 at 8:47 am

    This is a total stab in the dark, but it may at least set you in the right direction…

    Combining the page(n) pseudo-element selector, the float / float-modifier properties, and possibly CSS4 parent selectors may provide some sort of solution.

    Here are few behaviors an example:

    /* CSS3 GCPM */
    #image-a::page(2) {
      page-break-before: auto;
      float: top next-page;
      margin-bottom: -320px; /* Assuming the image height is 320px */
    }
    
    /* CSS4 Parent Selector */
    $#image-a ::page(2) {
      page-break-before: auto;
      float: top next-page;
      margin-bottom: -320px; /* Assuming the image height is 320px */
    }
    

    This basically states that if image-a actually wraps onto a second page, that a float should be applied to it, sending it to the top of the next page. Depending on how browsers choose to render this, you may get the result you are looking for (Hopefully):

    1. Wrapping into the second page is detected
    2. The page-break-before property forces the float property to apply to entire elements (or the parent selector does it’s job)
    3. The float and margin properties takes the element out of document flow and allow other content to take it’s space

    I know this is a real stretch and will not work, but perhaps it will trigger a line of thought allowing you come up with a more solid solution 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a specific issue with general console printing and I was wondering whether
I have a simple, general question regarding a real small issue that bothers me:
I have a MonoTouch application that generates some PDFs locally and then prints them
I'm using the following code... var result = document.evaluate(expr,context,null,9,null); When printing the result I
i'm using the jQuery Print Element plugin for printing but i think it's a
Can anyone point to libraries that can be used for Printing from Compact .Net
I have a list of items with some details that I would like to
I'm doing the next: docToPrint.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize(Custom, (int)Math.Round(DocWidth / 0.254), (int)Math.Round(DocHeight / 0.254));
I'm printing some figures in MATLAB in PDF form, and can view them fine
When printing a report, the user sometime have the following error: CrystalDecisions.CrystalReports.Engine.LogOnException: Error in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.