• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

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

Views

464

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

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

Screen Shot 2017-05-22 at 15.57.15.pngScreen Shot 2017-05-22 at 15.57.18.pngScreen Shot 2017-05-22 at 15.57.29.pngScreen Shot 2017-05-22 at 15.59.45.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 23, 2017 May 23, 2017

Copy link to clipboard

Copied

Sorry I don't see how your answer is making any sense, yes the 1px=1pt at 72dpi but what is the utility in exporting a css from a layer if it is only applying to 72dpi and not proportionally? Also ... I don't understand when you say "you have to take them up with the people you provided it" I am a designer and I am trying to extrapolate the css from the layers for a markups to hand over to the back end developers but this feature of photoshop gives me the 20pt=20px conversion so it is not useful at all.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 23, 2017 May 23, 2017

Copy link to clipboard

Copied

LATEST
yes the 1px=1pt at 72dpi but what is the utility in exporting a css from a layer if it is only applying to 72dpi and not proportionally?

Pixels would seem to make perfect sense for a pixel oriented image editing application and I noticed no claim in the Reference that Photoshop offers any other length-units in the CSS properties it provides.

If you want something different you may have to calculate that depending on the resolution.

I don't understand when you say "you have to take them up with the people you provided it"

As for the Endmemo-page you linked to: I noticed no option to set the resolution so what good is it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines