Skip to content

Commit 9618a47

Browse files
committed
Editorial tweaks suggested by elika.
1 parent 9973a30 commit 9618a47

2 files changed

Lines changed: 66 additions & 71 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 42 additions & 47 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, 31 January 2012</h2>
32+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 6 February 2012</h2>
3333

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

3838

3939
<dd><a
@@ -280,13 +280,13 @@ <h2 id=intro><span class=secno>1. </span> Introduction</h2>
280280

281281
<p>CSS 2.1 defined four layout modes &mdash; algorithms which determine the
282282
size and position of boxes based on their relationships with their sibling
283-
and ancestor boxes: block layout, designed for laying out documents and
284-
simple applications; inline layout, designed for laying out text; table
285-
layout, designed for laying out information in a tabular format; and
286-
positioned layout, designed for very explicit positioning without much
287-
regard for other elements in the document. This module introduces a new
288-
layout mode, flexbox layout, which is designed for laying out more complex
289-
applications and webpages.
283+
and ancestor boxes: block layout, designed for laying out documents;
284+
inline layout, designed for laying out text; table layout, designed for
285+
laying out information in a tabular format; and positioned layout,
286+
designed for very explicit positioning without much regard for other
287+
elements in the document. This module introduces a new layout mode,
288+
flexbox layout, which is designed for laying out more complex applications
289+
and webpages.
290290

291291
<p>Flexbox layout is superficially similar to block layout. It lacks many
292292
of the more complex text or document-formatting properties that can be
@@ -304,6 +304,33 @@ <h2 id=intro><span class=secno>1. </span> Introduction</h2>
304304
dimensions, wrapping into separate lines in a fashion similar to how text
305305
is wrapped into multiple lines.
306306

307+
<div class=example>
308+
<p>For example, the following HTML snippet uses flexbox to create a
309+
toolbar with icons. The flexbox is horizontal, and the children's widths
310+
don't fill the flexbox's width, so the additional space is distributed
311+
around and between the children. As the flexbox grows (perhaps because
312+
the user is viewing the page on a wider screen), the children spread out
313+
evenly and automatically:</p>
314+
315+
<pre>
316+
&lt;ul>
317+
&lt;li>&lt;button>&lt;img src='new.svg' alt="New">&lt;/button>&lt;/li>
318+
&lt;li>&lt;button>&lt;img src='upload.svg' alt="Upload">&lt;/button>&lt;/li>
319+
&lt;li>&lt;button>&lt;img src='save.svg' alt="Save">&lt;/button>&lt;/li>
320+
&lt;li>&lt;button>&lt;img src='trash.svg' alt="trash">&lt;/button>&lt;/li>
321+
&lt;/ul>
322+
&lt;style>
323+
ul { display: flexbox; flex-pack: distribute; }
324+
/* Irrelevant styling for this example removed. */
325+
&lt;/style></pre>
326+
327+
<div class=figure> <img height=140 src="images/toolbar-example.svg"
328+
width=400>
329+
<p class=caption>Example rendering of the above code snippet, at two
330+
different flexbox widths.</p>
331+
</div>
332+
</div>
333+
307334
<h3 id=placement><span class=secno>1.1. </span> Module interactions</h3>
308335

309336
<p>This module extends the definition of the &lsquo;<code
@@ -327,22 +354,17 @@ <h3 id=values><span class=secno>1.2. </span> Values</h3>
327354

328355
<p>In addition to the property-specific values listed in their definitions,
329356
all properties defined in this specification also accept the <a
330-
href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
331-
keyword as their property value. For readability it has not been repeated
332-
explicitly.
357+
href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">&lsquo;<code
358+
class=css>inherit</code>&rsquo;</a> keyword as their property value. For
359+
readability it has not been repeated explicitly.
333360

334361
<h2 id=box-model><span class=secno>2. </span> The Flexbox Box Model</h2>
335362

336363
<p>An element with &lsquo;<code class=css>display:flexbox</code>&rsquo; or
337364
&lsquo;<code class=css>display:inline-flexbox</code>&rsquo; is a <dfn
338-
id=flexbox>flexbox</dfn>. Block-level children of a flexbox, and some
339-
other types of children, are called <dfn id=flexbox-item
340-
title="flexbox item|flexbox items|flexbox item's">flexbox items</dfn> and
341-
are laid out using the flexbox box model. <span class=note>(See the <a
342-
href="#flex-items">Flexbox Items</a> chapter, below, for specifics on
343-
which children are <a href="#flexbox-item"><i>flexbox items</i></a>
344-
directly and which children are instead wrapped in anonymous boxes which
345-
are then <a href="#flexbox-item"><i>flexbox items</i></a>)</span>
365+
id=flexbox>flexbox</dfn>. Children of a flexbox are called <dfn
366+
id=flexbox-item title="flexbox item|flexbox items|flexbox item's">flexbox
367+
items</dfn> and are laid out using the flexbox box model.
346368

347369
<p>Unlike block layout, which is normally biased towards laying things out
348370
vertically, and inline layout, which is normally biased toward laying
@@ -413,33 +435,6 @@ <h2 id=box-model><span class=secno>2. </span> The Flexbox Box Model</h2>
413435
the flexbox with the &lsquo;<a href="#flex-line-pack0"><code
414436
class=property>flex-line-pack</code></a>&rsquo; property.
415437

416-
<div class=example>
417-
<p>For example, the following HTML snippet uses flexbox to create a
418-
toolbar with icons. The flexbox is horizontal, and the children's widths
419-
don't fill the flexbox's width, so the additional space is distributed
420-
around and between the children. As the flexbox grows (perhaps because
421-
the user is viewing the page on a wider screen), the children spread out
422-
evenly and automatically:</p>
423-
424-
<pre>
425-
&lt;ul>
426-
&lt;li>&lt;button>&lt;img src='new.svg' alt="New">&lt;/button>&lt;/li>
427-
&lt;li>&lt;button>&lt;img src='upload.svg' alt="Upload">&lt;/button>&lt;/li>
428-
&lt;li>&lt;button>&lt;img src='save.svg' alt="Save">&lt;/button>&lt;/li>
429-
&lt;li>&lt;button>&lt;img src='trash.svg' alt="trash">&lt;/button>&lt;/li>
430-
&lt;/ul>
431-
&lt;style>
432-
ul { display: flexbox; flex-pack: distribute; }
433-
/* Irrelevant styling for this example removed. */
434-
&lt;/style></pre>
435-
436-
<div class=figure> <img height=140 src="images/toolbar-example.svg"
437-
width=400>
438-
<p class=caption>Example rendering of the above code snippet, at two
439-
different flexbox widths.</p>
440-
</div>
441-
</div>
442-
443438
<h3 id=display-flexbox><span class=secno>2.1. </span> New values for
444439
&lsquo;<code class=property>display</code>&rsquo; property</h3>
445440

css3-flexbox/Overview.src.html

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,33 @@ <h2 id="intro">
8282

8383
<p><em>This section is not normative.</em>
8484

85-
<p>CSS 2.1 defined four layout modes &mdash; algorithms which determine the size and position of boxes based on their relationships with their sibling and ancestor boxes: block layout, designed for laying out documents and simple applications; inline layout, designed for laying out text; table layout, designed for laying out information in a tabular format; and positioned layout, designed for very explicit positioning without much regard for other elements in the document. This module introduces a new layout mode, flexbox layout, which is designed for laying out more complex applications and webpages.</p>
85+
<p>CSS 2.1 defined four layout modes &mdash; algorithms which determine the size and position of boxes based on their relationships with their sibling and ancestor boxes: block layout, designed for laying out documents; inline layout, designed for laying out text; table layout, designed for laying out information in a tabular format; and positioned layout, designed for very explicit positioning without much regard for other elements in the document. This module introduces a new layout mode, flexbox layout, which is designed for laying out more complex applications and webpages.</p>
8686

8787
<p>Flexbox layout is superficially similar to block layout. It lacks many of the more complex text or document-formatting properties that can be used in block layout, such as 'float' and 'columns', but in return it gains more simple and powerful tools for aligning its contents in ways that webapps and complex web pages often need. </p>
8888

8989
<p>The contents of a flexbox can be laid out in any direction (left, right, down, or even up!), can have their order swapped around dynamically (i.e., display order is independent of source order), and can "flex" their sizes and positions to respond to the available space. If a flexbox is <i>multi-line</i>, the flexbox items flow in two dimensions, wrapping into separate lines in a fashion similar to how text is wrapped into multiple lines.</p>
9090

91+
<div class="example">
92+
<p>For example, the following HTML snippet uses flexbox to create a toolbar with icons. The flexbox is horizontal, and the children's widths don't fill the flexbox's width, so the additional space is distributed around and between the children. As the flexbox grows (perhaps because the user is viewing the page on a wider screen), the children spread out evenly and automatically:</p>
93+
94+
<pre>
95+
&lt;ul>
96+
&lt;li>&lt;button>&lt;img src='new.svg' alt="New">&lt;/button>&lt;/li>
97+
&lt;li>&lt;button>&lt;img src='upload.svg' alt="Upload">&lt;/button>&lt;/li>
98+
&lt;li>&lt;button>&lt;img src='save.svg' alt="Save">&lt;/button>&lt;/li>
99+
&lt;li>&lt;button>&lt;img src='trash.svg' alt="trash">&lt;/button>&lt;/li>
100+
&lt;/ul>
101+
&lt;style>
102+
ul { display: flexbox; flex-pack: distribute; }
103+
/* Irrelevant styling for this example removed. */
104+
&lt;/style></pre>
105+
106+
<div class='figure'>
107+
<img src="images/toolbar-example.svg" width=400 height=140>
108+
<p class='caption'>Example rendering of the above code snippet, at two different flexbox widths.</p>
109+
</div>
110+
</div>
111+
91112
<h3 id="placement">
92113
Module interactions</h3>
93114

@@ -98,12 +119,12 @@ <h3 id="values">
98119

99120
<p>This specification follows the <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> from [[!CSS21]]. Value types not defined in this specification are defined in CSS Level 2 Revision 1 [[!CSS21]]. Other CSS modules may expand the definitions of these value types: for example [[CSS3COLOR]], when combined with this module, expands the definition of the &lt;color&gt; value type as used in this specification.</p>
100121

101-
<p>In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a> keyword as their property value. For readability it has not been repeated explicitly.
122+
<p>In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">''inherit''</a> keyword as their property value. For readability it has not been repeated explicitly.
102123

103124
<h2 id='box-model'>
104125
The Flexbox Box Model</h2>
105126

106-
<p>An element with ''display:flexbox'' or ''display:inline-flexbox'' is a <dfn>flexbox</dfn>. Block-level children of a flexbox, and some other types of children, are called <dfn title="flexbox item|flexbox items|flexbox item's" id="flexbox-item">flexbox items</dfn> and are laid out using the flexbox box model. <span class='note'>(See the <a href="#flex-items">Flexbox Items</a> chapter, below, for specifics on which children are <i>flexbox items</i> directly and which children are instead wrapped in anonymous boxes which are then <i>flexbox items</i>)</span></p>
127+
<p>An element with ''display:flexbox'' or ''display:inline-flexbox'' is a <dfn>flexbox</dfn>. Children of a flexbox are called <dfn title="flexbox item|flexbox items|flexbox item's" id="flexbox-item">flexbox items</dfn> and are laid out using the flexbox box model.</p>
107128

108129
<p>Unlike block layout, which is normally biased towards laying things out vertically, and inline layout, which is normally biased toward laying things out horizontally, the flexbox layout algorithm is agnostic as to the direction the flexbox happens to be laid out in. To make it easier to talk about flexbox layout in a general way, we will define several direction-agnostic terms here to make the rest of the spec easier to read and understand.</p>
109130

@@ -120,27 +141,6 @@ <h2 id='box-model'>
120141

121142
<p>In the <i>cross axis</i>, <i>flexbox items</i> can either "flex" to fill the available space or be aligned within the space with the 'flex-align' property. If a flexbox is <i>multi-line</i>, new lines are added in the <i>cross-end</i> direction, and can similarly be aligned, centered, or distributed within the flexbox with the 'flex-line-pack' property.</p>
122143

123-
<div class="example">
124-
<p>For example, the following HTML snippet uses flexbox to create a toolbar with icons. The flexbox is horizontal, and the children's widths don't fill the flexbox's width, so the additional space is distributed around and between the children. As the flexbox grows (perhaps because the user is viewing the page on a wider screen), the children spread out evenly and automatically:</p>
125-
126-
<pre>
127-
&lt;ul>
128-
&lt;li>&lt;button>&lt;img src='new.svg' alt="New">&lt;/button>&lt;/li>
129-
&lt;li>&lt;button>&lt;img src='upload.svg' alt="Upload">&lt;/button>&lt;/li>
130-
&lt;li>&lt;button>&lt;img src='save.svg' alt="Save">&lt;/button>&lt;/li>
131-
&lt;li>&lt;button>&lt;img src='trash.svg' alt="trash">&lt;/button>&lt;/li>
132-
&lt;/ul>
133-
&lt;style>
134-
ul { display: flexbox; flex-pack: distribute; }
135-
/* Irrelevant styling for this example removed. */
136-
&lt;/style></pre>
137-
138-
<div class='figure'>
139-
<img src="images/toolbar-example.svg" width=400 height=140>
140-
<p class='caption'>Example rendering of the above code snippet, at two different flexbox widths.</p>
141-
</div>
142-
</div>
143-
144144

145145
<h3 id='display-flexbox'>
146146
New values for 'display' property</h3>

0 commit comments

Comments
 (0)