Skip to content

Commit 80ae736

Browse files
committed
added example and a picture for flex property intro
1 parent a5956a9 commit 80ae736

2 files changed

Lines changed: 66 additions & 80 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 49 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030
<h1 id=head-box-flexible>CSS Flexible Box Layout Module</h1>
3131

32-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 28 February 2012</h2>
32+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 29 February 2012</h2>
3333

3434
<dl>
3535
<dt>This version:
36-
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120228/">http://www.w3.org/TR/2012/ED-css3-flexbox-20120228/</a>-->
36+
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120229/">http://www.w3.org/TR/2012/ED-css3-flexbox-20120229/</a>-->
3737

3838

3939
<dd><a
@@ -78,7 +78,7 @@ <h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 28 February 2012</h2>
7878

7979
<dd><a
8080
href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a>
81-
with subject line "<code>[css3-flexbox] message topic</code>"
81+
with subject line "<code>[css3-flexbox] message topic</code>"
8282

8383
<dt>Editors:
8484

@@ -344,12 +344,12 @@ <h3 id=values><span class=secno>1.2. </span> Values</h3>
344344
href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
345345
definition conventions</a> from <a href="#CSS21"
346346
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. Value types not defined in
347-
this specification are defined in CSS Level 2 Revision 1 <a href="#CSS21"
348-
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. Other CSS modules may expand
349-
the definitions of these value types: for example <a href="#CSS3COLOR"
350-
rel=biblioentry>[CSS3COLOR]<!--{{CSS3COLOR}}--></a>, when combined with
351-
this module, expands the definition of the &lt;color&gt; value type as
352-
used in this specification.
347+
this specification are defined in CSS Level 2 Revision 1 <a
348+
href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. Other CSS
349+
modules may expand the definitions of these value types: for example <a
350+
href="#CSS3COLOR" rel=biblioentry>[CSS3COLOR]<!--{{CSS3COLOR}}--></a>,
351+
when combined with this module, expands the definition of the
352+
&lt;color&gt; value type as used in this specification.
353353

354354
<p>In addition to the property-specific values listed in their definitions,
355355
all properties defined in this specification also accept the <a
@@ -1257,34 +1257,23 @@ <h2 id=flexibility><span class=secno>7. </span> Flexibility: the &lsquo;<a
12571257

12581258
<div class=example>
12591259
<p>Flexibility allows elements to respond directly to the available space,
1260-
in ways that are difficult or impossible in normal CSS. One common
1261-
example is a page with one segment intended to stay on screen, and
1262-
another section which may be long but which shouldn't scroll the page,
1263-
like a chat room:</p>
1260+
optionally taking into account size of content:</p>
12641261

12651262
<pre>
12661263
&lt;!DOCTYPE html>
1267-
&lt;body>
1268-
&lt;header>Channel: #csswg Topic: CSS IS AWE SOME&lt;/header>
1269-
&lt;article id='messages'>
1270-
&lt;p>&lt;b>Tab Atkins:&lt;/b>
1271-
I think the layout algorithm is done.&lt;/p>
1272-
&lt;p>&lt;b>Fantasai:&lt;/b>
1273-
SUBMIT BEFORE ZOD.&lt;/p>
1274-
...
1275-
&lt;/article>
1276-
&lt;form>
1277-
&lt;input name='message'>
1278-
&lt;button type='submit'>Send&lt;/button>
1279-
&lt;/form>
1280-
&lt;/body>
1281-
&lt;style>
1282-
body { display:flexbox; flex-flow: column; }
1283-
#messages { flex:1; }
1284-
&lt;/style></pre>
1285-
1286-
<p class=issue>Illustrate this example.</p>
1287-
</div>
1264+
&lt;style>
1265+
div { display:flexbox; outline:1px solid silver; }
1266+
p { flex:1 auto; margin:1em; background:gold; }
1267+
&lt;/style&gt;
1268+
&lt;div&gt;
1269+
&lt;p&gt;&quot;flexing&quot;&lt;/p&gt;
1270+
&lt;p&gt;allows the items to get bigger&lt;/p&gt;
1271+
&lt;p&gt;or&lt;/p&gt;
1272+
&lt;p&gt;smaller&lt;/p&gt;
1273+
&lt;/div&gt;
1274+
</pre>
1275+
<img alt="items with equal flexibility extend by equal amount"
1276+
src="images/wp7zxxyu.gif"></div>
12881277

12891278
<h2 id=alignment><span class=secno>8. </span> Alignment</h2>
12901279

@@ -2126,9 +2115,9 @@ <h2 id=pagination><span class=secno>10. </span> Page breaks in flexbox</h2>
21262115
class=property>break-</code>&rsquo; properties are supported on flexbox,
21272116
on flexbox items and inside flexbox items.
21282117

2129-
<p>The following breaking rules refer to fragmentation container as �page�.
2130-
The same rules apply to any other fragmenters. Change �page� to the
2131-
appropriate fragmenter type as needed.
2118+
<p>The following breaking rules refer to fragmentation container as
2119+
“page”. The same rules apply to any other fragmenters. Change
2120+
“page” to the appropriate fragmenter type as needed.
21322121

21332122
<p>Breaks in and around flexbox are determined as follows:
21342123

@@ -2137,9 +2126,9 @@ <h2 id=pagination><span class=secno>10. </span> Page breaks in flexbox</h2>
21372126
have effect as normal. If breaks inside flexbox are allowed, break points
21382127
are determined using following rules.
21392128

2140-
<li>When flexbox is continued after a break, flexboxs available space in
2141-
block direction is reduced by space consumed in previous pages. Consumed
2142-
space before page break is:
2129+
<li>When flexbox is continued after a break, flexboxs available space
2130+
in block direction is reduced by space consumed in previous pages.
2131+
Consumed space before page break is:
21432132
<ol>
21442133
<li>If flexbox starts on that page: the distance between start of
21452134
content box of the flexbox and the end of available space
@@ -2177,7 +2166,8 @@ <h2 id=pagination><span class=secno>10. </span> Page breaks in flexbox</h2>
21772166
id=break-inside-a-flexbox-item-is-considere>break inside a flexbox item
21782167
is considered</dfn> as follows:
21792168
<ol>
2180-
<li>If the item has �break-inside:avoid�, it is pushed to the next page
2169+
<li>If the item has “break-inside:avoid”, it is pushed to the next
2170+
page
21812171

21822172
<li>Otherwise, it may be broken, according to breaking rules and
21832173
algorithms applicable to its display type.
@@ -2204,12 +2194,12 @@ <h2 id=pagination><span class=secno>10. </span> Page breaks in flexbox</h2>
22042194
main-axis sizes of items until total size exceeds avaialble space or a
22052195
forced break is encountered.
22062196

2207-
<li>If border box of an item doesnt fit in available space, a break
2197+
<li>If border box of an item doesnt fit in available space, a break
22082198
inside the item is considered
22092199

22102200
<li>
22112201
<p>Items that fit on a page completely or partially are aligned
2212-
according to flex-pack property, independently from the rest of
2202+
according to flex-pack property, independently from the rest of
22132203
flexbox content.</p>
22142204

22152205
<p>Note that flexible lenghts are not recalculated on each page, even
@@ -2229,8 +2219,8 @@ <h2 id=pagination><span class=secno>10. </span> Page breaks in flexbox</h2>
22292219
<li>Items are collected in lines and laid out as usual, but in available
22302220
space on current page.
22312221

2232-
<li>If border box of an item doesnt fit on main-axis and it is the only
2233-
item in its line:
2222+
<li>If border box of an item doesnt fit on main-axis and it is the
2223+
only item in its line:
22342224
<ol>
22352225
<li>If the flexbox is not at the top of the page, it is moved to the
22362226
next page.
@@ -2267,11 +2257,11 @@ <h2 id=pagination><span class=secno>10. </span> Page breaks in flexbox</h2>
22672257
<li>Any items with baseline alignment must be aligned before considering
22682258
breaks inside items.
22692259

2270-
<li>If border box of an item doesnt fit in current page, a break inside
2271-
the item is considered
2260+
<li>If border box of an item doesnt fit in current page, a break
2261+
inside the item is considered
22722262

22732263
<li>Items that have fit completely on a previous page and items that are
2274-
pushed to next page dont have any rendering, leaving empty space as
2264+
pushed to next page dont have any rendering, leaving empty space as
22752265
needed.
22762266

22772267
<li>Items that fit completely or partially on current page are aligned
@@ -2346,26 +2336,27 @@ <h2 id=conformance><span class=secno>11. </span> Conformance</h2>
23462336
<h3 id=conventions><span class=secno>11.1. </span> Document conventions</h3>
23472337

23482338
<p>Conformance requirements are expressed with a combination of descriptive
2349-
assertions and RFC 2119 terminology. The key words �MUST�, �MUST NOT�,
2350-
�REQUIRED�, �SHALL�, �SHALL NOT�, �SHOULD�, �SHOULD NOT�, �RECOMMENDED�,
2351-
�MAY�, and �OPTIONAL� in the normative parts of this document are to be
2352-
interpreted as described in RFC 2119. However, for readability, these
2353-
words do not appear in all uppercase letters in this specification.
2339+
assertions and RFC 2119 terminology. The key words “MUST”, “MUST
2340+
NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
2341+
“SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
2342+
normative parts of this document are to be interpreted as described in RFC
2343+
2119. However, for readability, these words do not appear in all uppercase
2344+
letters in this specification.
23542345

23552346
<p>All of the text of this specification is normative except sections
23562347
explicitly marked as non-normative, examples, and notes. <a
23572348
href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
23582349

2359-
<p>Examples in this specification are introduced with the words for
2360-
example or are set apart from the normative text with
2350+
<p>Examples in this specification are introduced with the words for
2351+
example or are set apart from the normative text with
23612352
<code>class="example"</code>, like this:
23622353

23632354
<div class=example>
23642355
<p>This is an example of an informative example.</p>
23652356
</div>
23662357

2367-
<p>Informative notes begin with the word Note and are set apart from the
2368-
normative text with <code>class="note"</code>, like this:
2358+
<p>Informative notes begin with the word Note and are set apart from
2359+
the normative text with <code>class="note"</code>, like this:
23692360

23702361
<p class=note>Note, this is an informative note.
23712362

@@ -2499,7 +2490,7 @@ <h3 id=cr-exit-criteria><span class=secno>11.6. </span> CR exit criteria</h3>
24992490

25002491
<li>is available to the general public. The implementation may be a
25012492
shipping product or other publicly available version (i.e., beta
2502-
version, preview release, or nightly build). Non-shipping product
2493+
version, preview release, or nightly build). Non-shipping product
25032494
releases must have implemented the feature(s) for a period of at least
25042495
one month in order to demonstrate stability.
25052496

css3-flexbox/Overview.src.html

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -608,31 +608,26 @@ <h2 id='flexibility'>
608608
<p>A ''&lt;flex>'' value is transitionable, by transitioning the <i>preferred size</i>, <i>positive flexibility</i>, and <i>negative flexibility</i> independently. ''&lt;flex>'' can also transition to and from a &lt;length>, by treating the length as if it were a flexible length with a positive and negative flexibility of zero and a preferred size of the length.</p>
609609

610610
<div class='example'>
611-
<p>Flexibility allows elements to respond directly to the available space, in ways that are difficult or impossible in normal CSS. One common example is a page with one segment intended to stay on screen, and another section which may be long but which shouldn't scroll the page, like a chat room:</p>
611+
<p>Flexibility allows elements to respond directly to the available space,
612+
optionally taking into account size of content:</p>
612613

613614
<pre>
614615
&lt;!DOCTYPE html>
615-
&lt;body>
616-
&lt;header>Channel: #csswg Topic: CSS IS AWE SOME&lt;/header>
617-
&lt;article id='messages'>
618-
&lt;p>&lt;b>Tab Atkins:&lt;/b>
619-
I think the layout algorithm is done.&lt;/p>
620-
&lt;p>&lt;b>Fantasai:&lt;/b>
621-
SUBMIT BEFORE ZOD.&lt;/p>
622-
...
623-
&lt;/article>
624-
&lt;form>
625-
&lt;input name='message'>
626-
&lt;button type='submit'>Send&lt;/button>
627-
&lt;/form>
628-
&lt;/body>
629-
&lt;style>
630-
body { display:flexbox; flex-flow: column; }
631-
#messages { flex:1; }
632-
&lt;/style></pre>
633-
634-
<p class='issue'>Illustrate this example.</p>
635-
</div>
616+
&lt;style>
617+
div { display:flexbox; outline:1px solid silver; }
618+
p { flex:1 auto; margin:1em; background:gold; }
619+
&lt;/style&gt;
620+
&lt;div&gt;
621+
&lt;p&gt;&quot;flexing&quot;&lt;/p&gt;
622+
&lt;p&gt;allows the items to get bigger&lt;/p&gt;
623+
&lt;p&gt;or&lt;/p&gt;
624+
&lt;p&gt;smaller&lt;/p&gt;
625+
&lt;/div&gt;
626+
</pre>
627+
628+
<img src="images/wp7zxxyu.gif" alt="items with equal flexibility extend by equal amount">
629+
630+
</div>
636631

637632
<h2 id='alignment'>
638633
Alignment</h2>

0 commit comments

Comments
 (0)