兼容ie6浏览器窗口四角固定背景代码

昨天有网友提问“如何在html页面四角放置图片”,下面就是答案,供这位网友参考。

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>浏览器窗口四角固定背景代码</title>
6 <style type="text/css">
7 html{
8 _overflow:hidden;/*for ie6*/
9 }
10 body {
11 margin:0;
12 padding:0;
13 _height:100%;/*for ie6*/
14 _overflow:auto;/*for ie6*/
15 }
16 .mainbox {
17 position:relative;
18 _position:inherit;/*for ie6*/
19 margin:20px;
20 display:block;
21 height:2000px;
22 background:#e2e2e2;
23 }
24 .topleft, .topright, .bottomleft, .bottomright {
25 position:fixed;
26 width:100px;
27 height:100px;
28 background-color:#990;
29 _position:absolute;/*for ie6*/
30 _z-index:-1;/*for ie6*/
31 }
32 .topleft {
33 left:0;
34 top:0;
35 }
36 .topright {
37 right:0;
38 top:0;
39 }
40 .bottomleft {
41 left:0;
42 bottom:0;
43 }
44 .bottomright {
45 right:0;
46 bottom:0;
47 }
48 </style>
49 </head>
50 <body>
51 <div class="topleft"></div>
52 <div class="topright"></div>
53 <div class="bottomleft"></div>
54 <div class="bottomright"></div>
55 <div class="mainbox">这里是内容区域填充文字</div>
56 </body>
57 </html>

转载于:https://www.cnblogs.com/imyeah/archive/2012/02/15/2353070.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值