问题
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