css:图片相对定位的情况下,左右居中显示

.center {
     position: absolute;
      left: 50%;
      top: 0;
      transform: translate(-50%,0);     
}
原文地址:https://www.cnblogs.com/duanzhenzhen/p/14270377.html