Skip to content

Commit 74ed8e7

Browse files
committed
Improve overview example code with comments and links. Make HTML more compact by ellipsizing parts of it.
1 parent 9c62dd3 commit 74ed8e7

2 files changed

Lines changed: 39 additions & 62 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@
206206

207207
<h1 id=head-box-flexible>CSS Flexible Box Layout Module</h1>
208208

209-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 24 July 2012</h2>
209+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 25 July 2012</h2>
210210

211211
<dl>
212212
<dt>This version:
213-
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120724/">http://www.w3.org/TR/2012/WD-css3-flexbox-20120724/</a>-->
213+
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120725/">http://www.w3.org/TR/2012/WD-css3-flexbox-20120725/</a>-->
214214

215215

216216
<dd><a
@@ -621,62 +621,52 @@ <h3 id=overview><span class=secno>1.1. </span> Overview</h3>
621621
box, regardless of the height of the description.
622622
</ul>
623623

624-
<div style="display:table;">
625-
<div style="display:table-cell;">
626-
<pre>
624+
<pre>
627625
&lt;style>
628626
#deals {
629-
display: flex;
630-
flex-flow: row wrap;
627+
display: flex; /* Flex layout so items <a
628+
href="#align-self"
629+
title="Flex items stretch by default.">have equal height</a> */
630+
flex-flow: row wrap; /* <a
631+
href="http://dev.w3.org/csswg/css3-flexbox/#flex-flow-property">Allow items to wrap into multiple lines</a> */
631632
}
632633
.sale-item {
633-
display: flex;
634-
flex-flow: column;
635-
padding: 1em;
634+
display: flex; /* Lay out each item using flex layout */
635+
flex-flow: column; /* <a
636+
href="#flex-flow-property">Lay out item's contents vertically</a> */
636637
}
637638
.sale-item > img {
638-
order: -1;
639-
align-self: center;
639+
order: -1; /* <a
640+
href="#order-property">Shift image before other content (in visual order)</a> */
641+
align-self: center; /* <a
642+
href="#align-self">Center the image cross-wise (horizontally)</a> */
640643
}
641644
.sale-item > button {
642-
margin: auto 5% 0;
645+
margin-top: auto; /* <a
646+
href="#auto-margins">Auto top margin pushes button to bottom</a> */
643647
}
644648
&lt;/style></pre>
645-
</div>
646649

647-
<div style="display:table-cell;">
648-
<pre>
650+
<pre>
649651
&lt;section id='deals'>
650652
&lt;section class='sale-item'>
651653
&lt;h1>Computer Starter Kit&lt;/h1>
652-
&lt;p>
653-
This is the best computer money can buy,
654-
if you don't have much money.
654+
&lt;p>This is the best computer money can buy, if you don't have much money.
655655
&lt;ul>
656656
&lt;li>Computer
657657
&lt;li>Monitor
658658
&lt;li>Keyboard
659659
&lt;li>Mouse
660660
&lt;/ul>
661-
&lt;img src="images/computer.jpg"
662-
alt='You get: a white computer with matching peripherals.'>
661+
&lt;img src='images/computer.jpg'
662+
alt='You get: a white computer with matching peripherals.'>
663663
&lt;button>BUY NOW&lt;/button>
664664
&lt;/section>
665-
666665
&lt;section class='sale-item'>
667-
&lt;h1>Printer&lt;/h1>
668-
&lt;p>
669-
Only capable of printing
670-
ASCII art.
671-
&lt;ul>
672-
&lt;li>Paper and ink not included.
673-
&lt;/ul>
674-
&lt;img src="images/printer.jpg" alt='You get: beautiful ASCII art.'>
675-
&lt;button>BUY NOW&lt;/button>
666+
676667
&lt;/section>
668+
677669
&lt;/section></pre>
678-
</div>
679-
</div>
680670
<figure>
681671
<div id=overview-example>
682672
<div class=col></div>

css3-flexbox/Overview.src.html

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -350,57 +350,44 @@ <h3 id="overview">
350350
regardless of the height of the description.
351351
</ul>
352352

353-
<div style="display:table;">
354-
<div style="display:table-cell;"><pre>
353+
<pre>
355354
&lt;style>
356355
#deals {
357-
display: flex;
358-
flex-flow: row wrap;
356+
display: flex; /* Flex layout so items <a href="#align-self" title="Flex items stretch by default.">have equal height</a> */
357+
flex-flow: row wrap; /* <a href="http://dev.w3.org/csswg/css3-flexbox/#flex-flow-property">Allow items to wrap into multiple lines</a> */
359358
}
360359
.sale-item {
361-
display: flex;
362-
flex-flow: column;
363-
padding: 1em;
360+
display: flex; /* Lay out each item using flex layout */
361+
flex-flow: column; /* <a href="#flex-flow-property">Lay out item's contents vertically</a> */
364362
}
365363
.sale-item > img {
366-
order: -1;
367-
align-self: center;
364+
order: -1; /* <a href="#order-property">Shift image before other content (in visual order)</a> */
365+
align-self: center; /* <a href="#align-self">Center the image cross-wise (horizontally)</a> */
368366
}
369367
.sale-item > button {
370-
margin: auto 5% 0;
368+
margin-top: auto; /* <a href="#auto-margins">Auto top margin pushes button to bottom</a> */
371369
}
372-
&lt;/style></pre></div>
373-
<div style="display:table-cell;"><pre>
370+
&lt;/style></pre>
371+
<pre>
374372
&lt;section id='deals'>
375373
&lt;section class='sale-item'>
376374
&lt;h1>Computer Starter Kit&lt;/h1>
377-
&lt;p>
378-
This is the best computer money can buy,
379-
if you don't have much money.
375+
&lt;p>This is the best computer money can buy, if you don't have much money.
380376
&lt;ul>
381377
&lt;li>Computer
382378
&lt;li>Monitor
383379
&lt;li>Keyboard
384380
&lt;li>Mouse
385381
&lt;/ul>
386-
&lt;img src="images/computer.jpg"
387-
alt='You get: a white computer with matching peripherals.'>
382+
&lt;img src='images/computer.jpg'
383+
alt='You get: a white computer with matching peripherals.'>
388384
&lt;button>BUY NOW&lt;/button>
389385
&lt;/section>
390-
391386
&lt;section class='sale-item'>
392-
&lt;h1>Printer&lt;/h1>
393-
&lt;p>
394-
Only capable of printing
395-
ASCII art.
396-
&lt;ul>
397-
&lt;li>Paper and ink not included.
398-
&lt;/ul>
399-
&lt;img src="images/printer.jpg" alt='You get: beautiful ASCII art.'>
400-
&lt;button>BUY NOW&lt;/button>
387+
&hellip;
401388
&lt;/section>
402-
&lt;/section></pre></div>
403-
</div>
389+
&hellip;
390+
&lt;/section></pre>
404391
<figure>
405392
<div id="overview-example">
406393
<div class="col"></div>

0 commit comments

Comments
 (0)