5

I've been researching about the use of pt vs. px on web development and after reading this article from W3C, it's clear to me that using pt can cause problems depending on the user's screen display.

Even so, there's one thing that's puzzling me. I've tested properties with pt as unit measures in Chrome, Firefox, Edge and IE and the four of them convert pt to px correctly (meaning that the value computed for each property is in px, even though I declared it as pt).

In the right: declared property; in the left: computed property.

If the browser is computing the values as px, I assume the problem with pt and screen displays is resolved, right? If it's not resolved, can someone explain to me why?

I'm trying to decide if it's ok to use pt in a project or if it's better for the developers to convert from pt to px while coding. Any new information about this topic is welcome, since it will improve the quality of our team's argument.

Ana Araujo
  • 51
  • 3
  • The article you link to doesn't state you shouldn't use `pt`, it just says that that unit is only required to be consistent when designing for _print_ with CSS. So the question is: is your project intended for paper or screen? If it's screen, use `px` as `1px` matches an exact unit on the screen, while a `pt` is actually defined as 1/72 of an inch, and inches are not consistently rendered on screens in different browsers and engines. So a point is an absolute unit for print, a pixel is for screens. Decide based on that. – somethinghere Oct 18 '19 at 15:33
  • https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-what-is-the-difference – Paulie_D Oct 18 '19 at 15:35
  • 1
    https://stackoverflow.com/questions/3557260/should-i-use-pt-or-px – Paulie_D Oct 18 '19 at 15:36

0 Answers0