You can’t translate inches into pixels because pixels vary in size depending on the device resolution.
There is an in (inch) unit in css which equates to 96px if memory serves me well but is only useful for printed output as on screen it will be bigger or smaller depending on the devices resolution and density.
You can of course create a shape that has the same aspect ratio as a playing card but you can’t have it as a real world size on every screen.
You can make it real size on your own screen by sticking a playing card on your monitor and increasing the css until it matches the card. Anyone who has the same monitor and computer settings as you will see the same size but anyone on higher or lower resolutions will see something different.
To convert the dimensions of a playing card (2.5 inches x 3.5 inches) to pixels, we need to determine the PPI (pixels per inch) of your screen. Given your screen resolution of 1280 x 720, we can estimate a typical PPI value of 96, which is common for many screens.
Using this PPI value, we can calculate the pixel dimensions:
Width: 2.5 inches * 96 PPI = 240 pixels
Height: 3.5 inches * 96 PPI = 336 pixels
Therefore, the dimensions of a playing card (2.5 inches x 3.5 inches) would be approximately 240 pixels x 336 pixels on your screen.
It’s important to note that this conversion assumes a standard 96 PPI. The actual appearance may vary slightly depending on your specific screen’s characteristics.
I have two monitors: one that is 27 inches diagonal (24x14, rounded, for ease of maths), and one that is 32 inches diagonal (28x15).
If i draw a 320x288 square (1/4 the width, and 4/10 the height) on my first monitor, it would be (24 * 0.25) = 6 inches wide, and (14*0.4) = 5.6 inches high.
If i draw that exact same square on my second monitor, it would be (28 * 0.25) = 7 inches wide, and (15*0.4) = 6 inches high.
They are not the same size in physical dimensions. That’s because the PPI changed. Because the monitor size changed.
You cannot convert Pixels to Inches in a Generalized manner. You can do it for a specific resolution and monitor size, but as soon as you move it to a different monitor or resolution, it will change.
I’m not sure if you are asking a question or telling me something.
The screenshot you posted matches my playing card exactly.
If you want it to fit your monitor in the same way then stick a playing card on your monitor and fiddle with the size until it matches.
As everyone here has tried to explain there is no correlation between between screen size and a real world size. Otherwise how could you watch people on the TV as the TV would need to be 6 feet tall.
All you can do is maintain the same aspect ratio so that its proportions are correct.
So get a piece of paper, a ruler and a pair of scissors and draw a box the size of a playing card on the paper and then cut it out. This is not rocket science.
That’s because inline-block elements are aligned on the baseline and that changes when you add the text. You would need to set vertical-align:middle to make them all the same.
However flex is a much better way to do this and @m_hutley has given you some working code for your layout.
I would suggest though that you remove the useless card-inner divs as they are unnecessary.