im learning css with w3schools, now I am trying to design a responsive navigation bar from this https://www.w3schools.com/css/tryit.asp?filename=trycss_navbar_vertical_responsive the problem is that apparently .content needs to specify the padding to get the layout I really want.
This is my layout without padding:
And this is with the padding padding: 1px 16px;
:
My question is, how did w3schools know that adding a padding would solve that problem?
I have tried to see with the element inspector, if any padding or margin is added to the document. but chrome doesn't highlight anything. so without the tutorial I would never have known how to fix it. Before, I only assumed that padding was used to create a space between the content and its container, but now it seems that padding does something else.