2012-09-29 23:42:29 -07:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
-->
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<style>
|
|
|
|
div.flexbox {
|
|
|
|
margin-bottom: 2px;
|
|
|
|
line-height: 0;
|
|
|
|
}
|
|
|
|
div.flexbox > * {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
div.a {
|
|
|
|
height: 20px;
|
|
|
|
width: 10px;
|
|
|
|
background: lightgreen;
|
|
|
|
}
|
|
|
|
div.b {
|
|
|
|
height: 20px;
|
|
|
|
width: 50px;
|
|
|
|
background: pink;
|
|
|
|
}
|
|
|
|
div.c {
|
|
|
|
height: 20px;
|
|
|
|
width: 100px;
|
|
|
|
background: orange;
|
|
|
|
}
|
|
|
|
.center {
|
|
|
|
width: -moz-max-content;
|
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<!-- default (start) -->
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/><div class="b"></div>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/><div class="b"/><div class="c"/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- flex-start -->
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/><div class="b"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/><div class="b"/><div class="c"/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- flex-end -->
|
|
|
|
<div class="flexbox" style="float:right; clear:right;">
|
|
|
|
<div class="a"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox" style="float:right; clear:right;">
|
|
|
|
<div class="a"/><div class="b"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox" style="float:right; clear:right;">
|
|
|
|
<div class="a"/><div class="b"/><div class="c"/>
|
|
|
|
</div>
|
|
|
|
<div style="clear:right;"></div>
|
|
|
|
|
|
|
|
<!-- center -->
|
|
|
|
<div class="flexbox center">
|
|
|
|
<div class="a"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox center">
|
|
|
|
<div class="a"/><div class="b"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox center">
|
|
|
|
<div class="a"/><div class="b"/><div class="c"/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- space-between -->
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a"/><div class="b" style="float: right"/>
|
|
|
|
</div>
|
|
|
|
<div class="flexbox">
|
|
|
|
<div class="a" style="display:block; float: left"/>
|
|
|
|
<div class="c" style="float:right"/>
|
|
|
|
<!-- Use fixed-size margins to subtract space for "a" and "c", and then
|
|
|
|
use auto margins to center 'b' within the remaining space -->
|
|
|
|
<div style="display: block; margin-left: 10px; margin-right: 100px">
|
|
|
|
<div class="b center"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- space-around -->
|
|
|
|
<div class="flexbox center">
|
|
|
|
<div class="a"/>
|
|
|
|
</div>
|
|
|
|
<!-- For these, we use a flex container with invisible flexible items
|
|
|
|
instead of packing space. That's simpler than trying to hack up
|
|
|
|
a width-independent reference case for "justify-content:space-around".
|
|
|
|
(There are other reftests to ensure that basic flex container
|
|
|
|
behavior is correct, so it's safe to rely on that.) -->
|
2012-10-15 12:42:43 -07:00
|
|
|
<div class="flexbox" style="display: flex">
|
|
|
|
<div style="flex: 0.5"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
<div class="a"/>
|
2012-10-15 12:42:43 -07:00
|
|
|
<div style="flex: 1"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
<div class="b"/>
|
2012-10-15 12:42:43 -07:00
|
|
|
<div style="flex: 0.5"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
</div>
|
2012-10-15 12:42:43 -07:00
|
|
|
<div class="flexbox" style="display: flex">
|
|
|
|
<div style="flex: 0.5"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
<div class="a"/>
|
2012-10-15 12:42:43 -07:00
|
|
|
<div style="flex: 1"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
<div class="b"/>
|
2012-10-15 12:42:43 -07:00
|
|
|
<div style="flex: 1"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
<div class="c"/>
|
2012-10-15 12:42:43 -07:00
|
|
|
<div style="flex: 0.5"/>
|
2012-09-29 23:42:29 -07:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|