Why write a pixel perfect layout? As I understand it, Position: relative AND negative margins are used for this. This is from one to three extra lines sometimes for each block! This, probably, has a bad effect on the speed of downloading the file, etc. And even so much hassle and really boring work for the layout designer. Explain your vision and need to use it, and do you use it in your work? Thank you.
Answer 1, authority 100%
Pixel Perfect is the standard that a layout block or page must match the layout of the design exactly, down to the pixel (hence the name “pixel perfect”). The permissible errors differ in different companies adhering to this standard – somewhere it is 1-2 pixels, somewhere up to 5, usually the vertical error is greater than the horizontal one. To achieve this, various plugins are used, for example PerfectPixel for Chrome, which allows you to overlay a screenshot of the design on the browser page and thus adjust the result.
Regarding the use of position: relative and others, you are wrong. Pixel-perfect is a technical requirement for layout, not a way to implement it. It is quite possible to achieve perfect match with the layout without using crutches like negative margins.
However, why this is necessary in principle is a rhetorical question. PixelPerfect as an ideology comes from the times when sites were typeset for specific permissions. The designer gave three layouts: for desktop, for tablets and for mobile, and it was required to achieve a complete match in all cases. But now there are too many devices and resolutions, in addition, in different browsers, pages may be displayed slightly differently – for example, due to the peculiarities of font rendering. Of course, you can achieve pixel-perfect if the customer insists on it, if he pays well and if you don’t feel sorry for your eyes. Personally, I reject any orders or jobs where pixel perfect is required (which is still fairly common). But many layout designers once learned how to typeset that way, they feel comfortable, and the customer is a perfectionist happy. In addition, sometimes this is the only opportunity for the customer to check the quality of the layout, if he himself does not know how to typeset.
Whether to use this standard in practice is your personal choice. It does not provide any technical advantages in the functioning of the site.
Answer 2, authority 8%
Why write a pixel perfect layout?
This is a throwback from the days when browsers displayed the same element through their own well …, and customers stubbornly ignored this fact.
– Yes, sir, the designer has made a beautiful picture – if you please do exactly that. And, yes, I do not care that the font is thin and sharp in the system – in the layout, the photoshopped is cool, muddy, fluffy, so serve it like that. Css for setting parameters of displaying fonts will begin to develop only in five years? And “mee tse not e … e”!