栅格化布局技术分析——负边距布局

 1 <!DOCTYPE HTML>
 2 <html lang="en-US">
 3 <head>
 4 <meta charset="UTF-8">
 5 <title>Flying Swing Layout</title>
 6 <style type="text/css">
 7 <!--
 8 *{ margin:0; padding:0;}
 9 .content_box{
10     padding:10px;
11     background:#e1e1e1;
12     border:1px dotted #ccc;
13 }
14 .bodyArea{ background:#f0f0f0;}
15 /*-- 关键部分代码 --*/
16 .bodyArea{ width:1250px; margin:50px auto; zoom:1;border:1px solid #aaa;padding:10px;}
17 .body_wrap{ zoom:1; border:0px solid #aaa;}
18 .body_wrap:after{ content:"."; display:block; height:0; clear:both; overflow:hidden;}
19 .main{ float:left; width:100%;}
20 .main_content{margin-left:240px; margin-right:200px;}
21 .side{ float:left; width:230px; margin-left:-100%;}
22 .extra{ float:left;  width:190px; margin-left:-190px;}
23 .clear{ display:block; height:0; clear:both; overflow:hidden;}
24 -->
25 </style>
26 </head>
27 <body>
28 <div class="bodyArea">
29     <div class="body_wrap">
30         <div class="main">
31             <div class="main_content">
32                 <div class="content_box">main:510px;
33                     <div style="height:600px;background:#888;">
34                         <div style="position:relative; left:100px;top:100px;width:200px;background:#aaa;">
35 
36                         ddd
37                         </div>
38                     </div>
39                 </div>
40             </div>
41         </div>
42         <div class="side">
43             <div class="content_box">side:230px;</div>
44         </div>
45         <div class="extra">
46             <div class="content_box">extra:190px;</div>
47         </div>
48     </div>
49 </div>
50 </body>
51 </html>

来自: http://www.jackness.org/?p=277

转载于:https://www.cnblogs.com/whatmiss/archive/2012/09/07/2674666.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值