浏览器全屏显示背景图片的css样式与html结构
内容摘要
css样式:
复制代码代码如下:
<style>
div#div1{
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
z-index:-1;
}
div#div1 > img {
height:100%;
width:10
复制代码代码如下:
<style>
div#div1{
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
z-index:-1;
}
div#div1 > img {
height:100%;
width:10
文章正文
css样式:
<style>
div#div1{
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
z-index:-1;
}
div#div1 > img {
height:100%;
width:100%;
border:0;
}
</style>
html:
<div id="div1"><img src="图片路径" /></div>
<div align="center">
<table>
<th>登录</th>
<tr>
<td>用户名:</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="text" /></td>
</tr>
<tr>
<td></td>
<td><input type="reset" /><input type="button" value="Login" /></td>
</tr>
</table>
</div>
复制代码
代码如下:<style>
div#div1{
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
z-index:-1;
}
div#div1 > img {
height:100%;
width:100%;
border:0;
}
</style>
html:
复制代码
代码如下:<div id="div1"><img src="图片路径" /></div>
<div align="center">
<table>
<th>登录</th>
<tr>
<td>用户名:</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="text" /></td>
</tr>
<tr>
<td></td>
<td><input type="reset" /><input type="button" value="Login" /></td>
</tr>
</table>
</div>
代码注释