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

css.at-rules.page.size - Safari does not handle print page margins correctly #23178

Open
arnavdugar opened this issue May 27, 2024 · 0 comments
Labels
data:css 🎨 Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS

Comments

@arnavdugar
Copy link

arnavdugar commented May 27, 2024

What type of issue is this?

Browser bug (a bug with a feature that may impact site compatibility)

What information was incorrect, unhelpful, or incomplete?

Safari does not handle print page margins correctly, for example

@media print {
  @page {
    margin: 2in;
  }
}

What browsers does this problem apply to, if applicable?

Safari

What did you expect to see?

The page for @page does not indicate that Safari is missing this feature.

Did you test this? If so, how?

Render this page, and print in both Chrome and Safari. On the printed page, the red box is centered in Chrome (correct), but is not centered in Safari (incorrect). I am using Safari version 17.0 (19616.1.27.211.1).

<!DOCTYPE html>
<style>
  @media print {
    @page {
      size: letter;
      margin: 2in;
    }
  }

  html {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  #main {
    background-color: red;
    height: 9in;
    width: 6.5in;
  }
</style>
<div id="main"></div>

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

No response

Do you have anything more you want to share?

Here is a related Stack Overflow page:
https://stackoverflow.com/questions/13154147/how-to-set-safari-print-margins-via-css-to-print-borderless

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/@page

MDN metadata

MDN page report details
  • Query: css.at-rules.page.size
  • Report started: 2024-05-27T05:17:36.029Z
@arnavdugar arnavdugar changed the title css.at-rules.page.size - Safari does not handle page margins correctly css.at-rules.page.size - Safari does not handle print page margins correctly May 27, 2024
@queengooborg queengooborg added the data:css 🎨 Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:css 🎨 Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS
Projects
None yet
Development

No branches or pull requests

3 participants
@arnavdugar @queengooborg and others