<html>
<head>
<style>
div
{
display:box; /* Firefox */
display:box; /* Safari and Chrome */
display:box;
width:300px;
border:1px solid black;
}
#p1
{
box-flex:1.0; /* Firefox */
box-flex:1.0; /* Safari and Chrome */
box-flex:1.0;
border:1px solid red;
}
#p2
{
box-flex:2.0; /* Firefox */
box-flex:2.0; /* Safari and Chrome */
box-flex:2.0;
border:1px solid blue;
}
</style>
</head>
<body>
<div>
<p id="p1">Hello</p>
<p id="p2">W3School</p>
</div>
<p><b>注释:</b>IE 不支持 box-flex 属性。</p>
</body>
</html>