Why is position:relative; right: 20px; offset to the left?

Why does position:relative; right: 20px; shift to the left relative to its original position?

Css
Mar.09,2021

right: 20px can be understood as: distance from its own right (right edge) 20px


upstairs is wrong, not equivalent to margin-left:-20, but padding-right:-20px; In this case, the width of its parent should be so wide, F12 can open the console, click the small arrow in the upper left corner, and then put it to see whether the width is very small


position:relative the object will be offset according to the LRTB (left,right,top,bottom) attribute in its normal position, right:20px is equivalent to margin-left:-20, so it is to the left.

Menu