Pixels in photoshop vs pixels in CSS?

我的梦境 提交于 2021-01-29 10:46:06

问题


I notice that when I measure out something in Photoshop to "ensure pixel perfection" it's usually half of what's measured in Photoshop to go to CSS. So if I measure at 60px, in CSS it goes to 30px.

But only roughly so.. Is there a way to make sure it matches 100% so I don't have to guesstimate? And why does this happen?


回答1:


When you are measuring out those pixels in Photoshop, you have to make sure you know what size your resolution is. For the web, it uses 72 dpi resolution, check in Photoshop under "image size" to see what resolution your image is. Sometimes images are at 300 dpi which if you use that and then try to save on the web will make the image larger than it should be.



来源:https://stackoverflow.com/questions/17885035/pixels-in-photoshop-vs-pixels-in-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!