0
点赞
收藏
分享

微信扫一扫

css实现background背景图片居中


以前写过一个用html实现图片做背景居中,那是利用html的定位position的z-index层次;img图片位于底层,文字在顶层!


.content{width: 100%;height: 500px;background:url(img/bj.gif) center center no-repeat;background-sise:auto 50%; }

内容为 content 的盒子 用背景定位达到位置始终居中!

举报

相关推荐

0 条评论