我需要添加背景图像到我的网站。但当我用
background-image:url('path_to_image'); 但这超出了我的集装箱类??如何制作容器类后面的图像?
发布于 2013-12-12 05:15:19
请看一下我的样品:
HTML :
<div class="container">
<div class="background">
</div>
<div class="infoContainer">
<input type="text" /><br/>
<label>Hi How are you</label>
</div>
</div>CSS :
.container {
height: 500px;
width: 200px;
z-index: 2;
color: #fff;
}
.background {
width: 200px;
height: 200px;
background-image: url('Images/index.jpg');
position: absolute;
z-index: 1;
}
.infoContainer {
position: absolute;
z-index: 2;
padding: 5px;
}输出:

发布于 2013-12-12 04:59:44
试着把它加到身体上
body {
background-image: url('path_to_image');
}发布于 2013-12-12 05:09:35
<body background="image_path">
If you have a static page
OR add style to your body tag
<body style="background-image:url('image_path');">https://stackoverflow.com/questions/20535372
复制相似问题