在较小的屏幕下展示一个超宽的图片,如何让图片居中显示?

1:背景图

background-position:center center;

2:定位

position:absolute;

left:50%;

margin-left:-width的一半;

3:给图片套一个盒子

这个盒子设置

text-align:center;

overflow:hidden;

图片设置margin:0 -100%;

原文地址:https://www.cnblogs.com/wangsai-666/p/11564164.html