CSS 自动背景布局

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片背景自适应</title>
<style type="text/css">
<!--
* {margin:0;padding:0;}
html{background:#FFFFFF;}
body{text-align:left;font:normal 12px/1.6em simsun, Verdana, Lucida, Arial, Helvetica, sans-erif;color:#353535;padding:130px;}
table{border-collapse:collapse;border-spacing:0;empty-cells:show;text-align:left;}
th,td{border-collapse:collapse;}
ol,ul{list-style:none;}
a {text-decoration:none;color:#353535;}
a:hover{color:#CD0102;}
input,select,form img,button{vertical-align:middle;}
button{border:0;cursor:pointer;}
img{border:0;display:block;}
em{font-style:normal;}
.cl{clear:both;}
 
.box{float:left;padding:11px 0 0 11px;background:url(/jscss/demoimg/200907/right.gif) no-repeat right top;overflow:hidden;position:relative;}
.bg_t{width:11px;height:100%;position:absolute;left:0;top:0;background:url(/jscss/demoimg/200907/left.gif) no-repeat left top;margin-bottom:-32767px;padding-bottom:32767px;/*高度自适应BUG*/}
.bg_b{height:11px;width:11px;background:url(/jscss/demoimg/200907/left.gif) no-repeat left bottom;position:absolute;left:0;bottom:0;}
.box img, .box p{padding:0 11px 11px 0;background:url(/jscss/demoimg/200907/right.gif) no-repeat right bottom;}
-->
</style>
</head>
 
<body>
<div class="box">
 <div class="bg_t"></div>
 <img src="http://www.baidu.com/img/baidu_logo.gif">
 <div class="bg_b"></div>
</div>
<div class="box">
 <div class="bg_t"></div>
 <img src="http://www.codefans.net/images/logo.gif" />
 <div class="bg_b"></div>
</div>
<div class="cl"></div>
<div class="box">
 <div class="bg_t"></div>
 <p>源码爱好者(CodeFans.net)提供各类编程源码、JavaScript/CSS特效代码以及常用软件下载等,做有质量的学习型源码下载站。</p>
 <div class="bg_b"></div>
</div>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值