如何获得div背景图像缩放到页面大小? [英] How can get the div background image to scale to the page size?
本文介绍了如何获得div背景图像缩放到页面大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图使div标题的背景图像缩放到页面的大小。这是目前的css:
I am trying to make the background image of the div header scale to the size of the page. Here is the current css:
.Header {
background-image: url(Images/logo.png);
height: 160px;
width: 960px;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
}
推荐答案
标题和宽度为100%
position:absolute;
width:100%;
这篇关于如何获得div背景图像缩放到页面大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文