Skip to main content
Participant
May 22, 2017
Question

Copying CSS from layer. Why it gives the wrong px pt conversion? 16pt=16px

  • May 22, 2017
  • 1 reply
  • 733 views

Hi, I am extrapolating the css of the different h1/2/3/4 ... from the layers in photoshop.

I noticed that the css is in PX but it gives me the conversion 1px=1pt which isn't correct. It is to say I have a copy of 16pt in Photoshop and the css gives me 16PX... but it is wrong! Should be 21.33px

I tried changing the units in the preferences in Photoshop to px but still it converts as 1pt=1px so the copy that was 16pt in photoshop is 16px if I put the units in pixels.

Is there a way to avoid this problem and have the correct conversion?

Otherwise CSS from layer is kind of pointless ....

thanks

Ale

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
May 22, 2017

Could you please post a screenshot taken at View > 100% and with the pertinent Panels (Layers, Channels, Options Bar, …) visible and the resulting CSS text for the selected Layer?

Participant
May 22, 2017

for example: If I stick to pt in the font size, then select the layer and copy the css, when I paste it outside in a note file it changed the 20pt to 20px instead of properly converting. I read that at 72dpi 1px it is almost same size as 1pt but shoudln't it being converted properly with %? px to Point Converter, Chart -- EndMemo

c.pfaffenbichler
Community Expert
Community Expert
May 23, 2017

Pixels are pixels, no matter what the image’s resolution is.

But at 72ppi 1px indeed translates to 1pt.

And as for the conversion: If you have problems with that you may have to take them up with the people who provided it.