B
B
birdsforhardcore2016-01-11 14:14:20
css
birdsforhardcore, 2016-01-11 14:14:20

How to correctly measure the dimensions in PSD for layout?

I'm building a website. I have a psd layout, I take measurements in it. Page width 1200, container 900, for example. That's all right. The container also has a 10px horizontal padding (I measure it with a ruler in psd). Nothing complicated either. But visually in the browser, these paddings should obviously be three times larger.
A similar situation arises not only with this size, but also with a number of others. What am I doing wrong? Can you trust photoshop after that?
Here's what's in Photoshop (a watering can in px) 8eaa74b73a1f4a6cb22a5513db255002.png
here's it in the browser (in the background there is a substrate from the layout image at 100% scale, the layout of the rest, except for the container, is not ready, of course)
9055c46bc1804c91aefa0c7f22024306.png
and here is the code codepen.io/birdsforhardcore/pen/RrgGRJ

Answer the question

In order to leave comments, you need to log in

6 answer(s)
G
goandkill, 2016-01-11
@goandkill

Maybe the ruler is not in pixels?

M
Maxim Postolov, 2016-01-24
@Bags85

If I understand your problem correctly, then you just have padding that increases the width of the container by 20px. "box-sizing: border-box" to the container will help. htmlbook.ru/css/box-sizing
And read htmlbook.ru/content/blochnye-elementy

M
Mr Crabbz, 2016-01-11
@Punkie

Well, then show the layout. Maybe it's not the layout, but the fact that you didn't reset the default paddings and don't use normalize.css.

N
Novomir Lobanov, 2016-01-21
@novomir

Most likely, a 10px indent was also applied to the background image, as a result, the shift turned out. Apply margin-left:-10px; and look at the result.

V
vatuma, 2016-01-21
@vatuma

The margins on the left of the page match the layout in Photoshop. Your matte has moved to the right by an additional 10px.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question