To know why this is the right answer we have to dig into how the CSS percentage unit works, the percentage unit is a CSS relative unit so it has to be relative to an absolute value, and this is summary of how it works with different properties:
So here we are working with padding top and left properties, and both are relative to the #container's width and be calculated based on its value.
You can find more about this here 😄👇
Your explanation is very straightforward and convincing... I will definitely fiddle with this. Thanks so much. @Abdelrahman . :)
You're welcome, I'm glad that you benefited from this. 😄😄
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.