I can't change the size of images, I made a simple code to show this:
HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<img src="./assets/desktop/image-glass-and-keyboard.jpg" width="400px" height="400px">
</body>
</html>
When I inspect the image it shows a width of 400px and a height of 400px, that's good:
However, when I use digital rulers (I used three digital rulers and the ruler of the Sketch software), the values of the width and height don't match:
I'm going crazy, I don't know why this is happening. I really need help.
EDIT
following the answers here, I'm still having problems. Let's change from px to cm, because cm is an absolute unit:
HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<img src="./assets/desktop/image-glass-and-keyboard.jpg" width="10cm" height="10cm">
</body>
The picture gets really small:
I think I'm more confused than before.


