In CSS, px is an absolute length block . They are mostly useful when the output environment is known.
For a CSS device, these dimensions are either tied (i), linking the physical units [in, cm, mm, pt, pc] with their physical dimensions, or (ii) linking the pixel block [px] to the reference pixel . [add and highlight]
If the reference pixel is half the devices displaying the physical pixel, a CSS value of 700 pixels will be displayed as 350 pixels in the display, or 50% in your question.
So, what you feel here is absolutely correct, CSS is correct in the sense that you select px units, you just skipped that the px in CSS does not match the pixel on the display. Since this is not the case, but you want it to be, it looks like you have chosen the wrong unit.
Again: absolute length units are mostly useful when the output environment is known.
Did you find a way to tell the browser to change this reference pixel? This will solve your problem. Or now that you know what is going on, identify the device and change the length accordingly.
Alternatively, you can replace your absolute lengths with relative (em, ex). Since they are relative, you only need to change the length of the element to which they refer to change the entire page.
This is usually done using absolute length in the <html> and / or <body> element and relative lengths for everything else.
This approach can help you solve the problem.
hakre source share