您好,欢迎访问一九零五行业门户网

背景图跟随界面大小而改变_html/css_WEB-ITnose

背景图 自动变化 css
有一张比较大的背景图2000×648
利用css设置为页面的背景
css如下:
body {text-align: left; font-family:新宋体; margin:auto;padding:0;
      font-size:12px;color:#0c0c0c; background-color: #fff; 
      background:url(../images/bj.gif) no-repeat;background-position: top center;}
请教大虾要怎么做可以让背景图片根据页面的大小而自动调整大小,始终显示全图,而不是一部分?
回复讨论(解决方案) 图片随着页面的大小而改变,
.css{
 width: 100%;
            position: absolute;
            margin-right: auto;
            margin-left: auto;
}

body {padding:0;margin:0;}img { position:absolute;width:100%;height:100%;z-index:-999;}
使用background的方式好像不能实现,等待高手讲解background实现方式。
其它类似信息

推荐信息