css:图片相对定位的情况下,左右居中显示 .center { position: absolute; left: 50%; top: 0; transform: translate(-50%,0); }