WEB中大屏图片居中显示,超出隐藏

15. December 2016 HTML5 0

有时候网页中需要全屏大图铺满屏幕,对于不同尺寸的显示器来说,超出部分就要隐藏,并且显示中间部分,如下:

<div style=”width: 100%; height:346px; overflow: hidden; background: url({IMG_PATH}yzgh/cwu.gif) no-repeat center;”>

</div>

把图片作为背景居中。


Leave a Reply

Your email address will not be published. Required fields are marked *