pt or px for specifying border-width for print
Asked Answered
S

3

1

should i use pt or px when specifying border-width in css for media print?

i basically just want hairlines

Salahi answered 6/7, 2010 at 14:9 Comment(0)
D
1

For print you should use pt, as it's an absolute unit not based on the resolution of the media.

Diastema answered 6/7, 2010 at 14:32 Comment(1)
That's the "correct" answer but the truth is a little more complicated. Browsers have methods to make pages print even when coded incorrectly with px units and other crazy stuff. You may find that it's simpler and better to be lazy like everyone else. For example, with Chrome, lines set with pt widths smaller than .8pt will not show up on screen or printed. However, on IE, they will show up as 1px on screen, and the correct size when printed (insofar as the printer DPI allows).Dolly
C
0

In general you should use points or em's in place of pixels when possible. The reason is that points and ems both scale with the users' resolution or zoom setting where pixels do not. On many larger, high definition or wide screen monitors individual pixels are too small to be reliably useful for placement.

Carrie answered 6/7, 2010 at 14:11 Comment(3)
i'm talking about printing on paper, no screen/pixels involved. that's why i asked this questionSalahi
Do you know what kind of resolution your printer is going to be using? You can certainly use pixels if you're going to print media, but a 600dpi Printer will produce different output than a 300dpi printer with a single pixel border.Carrie
Pixels may scale; they are not always exactly one physical pixel—see CSS 2.1 section 4.3.2. A 600dpi printer will not convert 1px to 1/600″, and extremely-high-def monitors also scale. The page ‘zoom’ feature by design zooms pixels as well as every other unit. Also pt is just as unresponsive to text size settings as px; it should only ever be used for print.Eggers
B
-2

for hairlines use just px

Bewitch answered 6/7, 2010 at 14:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.