transform:translate(-50%,-50%)

和父亲元素没关系,走自己盒子宽度一半

原文地址:https://www.cnblogs.com/Yanss/p/10252629.html