21、实例 使用盒模型布局之自适应窗口的弹性盒布局+改变显示顺序

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>使用盒模型布局之自适应窗口的弹性盒布局+改变显示顺序</title>
<style type="text/css">
/*主要属性:box-flex;
-moz-box-ordinal-group
-webkit-box-ordinal-group*/
body
{
    margin:0px;
    }
div#container
{


    display:box;
    display:-moz-box;
    display:-webkit-box;
    text-align:left;}
#left
{
    
    border:1px solid #aaf;
    width:280px;
    padding:20px;
    background-color:orange;
    -moz-box-ordinal-group:2;
    -webkit-box-ordinal-group:2;
    
    /*设置HTML组件的WIDTH属性包括边框*/
    box-sizing:border-box;
    -moz-box-sizing:border-box;
    border-radius:12px 12px 0px 0px;

}

#contents
{
    
/*    width:200px;*/
/*使用自适应分配余下空间,全部给contents*/
    -moz-box-flex:1;
    -webkit-box-flex:1;

    -moz-box-ordinal-group:1;
    -webkit-box-ordinal-group:1;

    border:1px solid #aaf;
    padding:20px;
    border:1px solid #aaf;
    
    /*设置HTML组件的WIDTH属性包括边框*/
    box-sizing:border-box;
    -moz-box-sizing:border-box;
    border-radius:12px 12px 0px 0px;
    
}

#right
{
    border:1px solid #aaf;
    width:200px;
    padding:20px;
    background-color:orange;
    
    -moz-box-ordinal-group:3;
    -webkit-box-ordinal-group:3;
    
    /*设置HTML组件的WIDTH属性包括边框*/
    box-sizing:border-box;
    -moz-box-sizing:border-box;
    border-radius:12px 12px 0px 0px;
    
}
</style>
</head>

<body>
<div style="margin:auto; text-align:center;">
<div id="container">

<div id="left" style="width:220px;">
<h2>XXXXXXXXXXXXX</h2>
<ul>
<li>XXXXXXXXXXXX</li>
<li>XXXXXXXXXXXX</li>
</ul>
</div>

<div id="contents" style="width:800px;">
<h2>XXXXXXXXXXXXXXX</h2>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX
</div>

<div id="right" style="width:240px;">
<h2>XXXXXXXXXXXXX</h2>
<ul>
<li>XXXXXXXXXXXX</li>
<li>XXXXXXXXXXXX</li>
<li>XXXXXXXXXXXX</li>
<li>XXXXXXXXXXXX</li>
</ul>
</div>

</div>
</div>


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值