Understanding measurements

Hey freiends! I’m sorry for all my questions, I truly appreciate you all for helping when you can. Mosh is talking about measurements in this lesson.

In this screenshot he changes the syntax from PX to % and says it nhow = 150 % super confused on how he got this value, with PX its easy you can just inspect and it will tell you, but this is throwing me off.

I hope I explained this enough. Thansk for the HELP!!!

Its because when you use % unit, it is calculated in relationship to the parent. So here the div with the class of box is inside the body, so body is the parent to box.

The width of body is 300px and because box is set to 50% it will be half the width of its parent body which is 150px. You can inspect and see the width value inside the computed tab of the element