Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pages" counter in non-root absolute boxes are broken #2029

Closed
baloersch opened this issue Dec 31, 2023 · 1 comment
Closed

"pages" counter in non-root absolute boxes are broken #2029

baloersch opened this issue Dec 31, 2023 · 1 comment
Labels
bug Existing features not working as expected
Milestone

Comments

@baloersch
Copy link

Perhaps Bug similar to: #1491

style position: absolute; causing incorrect redering...

markup and styles:
my.html

<!DOCTYPE html>
  <head>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <div class="pg">
      <div class="content">
        <div>
          <p>NORMAL CONTENT</p>
          <p>Your Total pages ARE: <span class="totalPages"></span> PAGES</p>
        </div>
      </div>
    </div>
    <div class="pg">
      <div class="content">
        <div class="footer">
          <p>FOOTER </p>
          <p>Your Total pages ARE: <span class="totalPages"></span> PAGES</p>
        </div>
      </div>
    </div>  
  </body>
</html>

style.css

@page:first {
    size: "A4";
    margin: 2cm 1.6cm 2cm 1.6cm;
    @bottom-right {
        content:"";
    }
}
@page {
    size: "A4";
    margin: 1.6cm 1.6cm 2cm 1.6cm;
    @bottom-right {
        content: counter(page);
    }
}
.pg {
    height: 26cm;
}
.content {
    width: 100%;
    height: inherit;
    position: relative;
}
.footer {
    width: 100%;
    height: 100px;
    position: absolute;
    bottom: 0;
}
span.totalPages:after {
    content: counter(pages);
}

bug

@liZe liZe added the bug Existing features not working as expected label Jan 2, 2024
@liZe
Copy link
Member

liZe commented Jan 28, 2024

The problem is actually really close to #1747. Your counter is in an absolute box whose parent is not the page, that’s the difference.

@liZe liZe changed the title tag containing counter(pages) witth .some_class { position: absolute; } showing "0" instead of total num of pages "pages" counter in non-root absolute boxes are broken Jan 29, 2024
@liZe liZe added this to the 61.0 milestone Jan 29, 2024
@liZe liZe closed this as completed in c6468e5 Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants