|
41 | 41 | background: yellow; color: black; |
42 | 42 | transform: rotate(3deg); |
43 | 43 | } |
| 44 | + |
| 45 | + .article-max-lines-demo { |
| 46 | + font: 1em/1.25 Times New Roman, Times, serif; |
| 47 | + white-space: nowrap; |
| 48 | + } |
| 49 | + .article-max-lines-demo.one::first-letter { |
| 50 | + font-size: 2em; |
| 51 | + line-height: 0.9; |
| 52 | + } |
| 53 | + .article-max-lines-demo.one { |
| 54 | + font-size: 1.5em; |
| 55 | + width: 16em; |
| 56 | + } |
| 57 | + .article-max-lines-demo.two { |
| 58 | + width: 11.5em; |
| 59 | + float: left; margin-right: 1em; |
| 60 | + } |
| 61 | + .article-max-lines-demo.three { |
| 62 | + width: 11.5em; |
| 63 | + float: left; |
| 64 | + } |
44 | 65 | </style> |
45 | 66 |
|
46 | 67 | <body> |
@@ -648,7 +669,59 @@ <h3 id=max-lines><span class=secno>3.2. </span>The ‘<a |
648 | 669 | <p class=issue>Should this apply to regions overflow only, or also to |
649 | 670 | pagination? |
650 | 671 |
|
651 | | - <p class=issue> TODO: ADD EXAMPLE HERE. |
| 672 | + <div class=example> |
| 673 | + <table class=source-demo-pair> |
| 674 | + <tbody> |
| 675 | + <tr> |
| 676 | + <td> |
| 677 | + <pre><!DOCTYPE HTML> |
| 678 | +<style> |
| 679 | + .article { |
| 680 | + overflow: regions; |
| 681 | + } |
| 682 | + .article::first-letter { |
| 683 | + font-size: 2em; |
| 684 | + line-height: 0.9; |
| 685 | + } |
| 686 | + .article::nth-region(1) { |
| 687 | + font-size: 1.5em; |
| 688 | + max-lines: 3; |
| 689 | + } |
| 690 | + .article::nth-region(n+2) { |
| 691 | + /* 2 and up */ |
| 692 | + column-count: 2; |
| 693 | + } |
| 694 | +</style> |
| 695 | +<div class="article"> |
| 696 | + <i>...</i> |
| 697 | +</div></pre> |
| 698 | + |
| 699 | + <td> |
| 700 | + <div class="article-max-lines-demo one">The max-lines property |
| 701 | + allows<br> |
| 702 | + authors to use a larger font for the first<br> |
| 703 | + few lines of an article. Without the</div> |
| 704 | + |
| 705 | + <div class="article-max-lines-demo two">max-lines property, |
| 706 | + authors<br> |
| 707 | + might have to use the<br> |
| 708 | + ‘<code class=property>height</code>’ property instead, but<br> |
| 709 | + that would leave a slight gap<br> |
| 710 | + if the author miscalculated<br> |
| 711 | + how much height a given<br> |
| 712 | + number of lines would<br> |
| 713 | + occupy (which might be</div> |
| 714 | + |
| 715 | + <div class="article-max-lines-demo three">particularly hard if the |
| 716 | + author<br> |
| 717 | + didn't know what text would<br> |
| 718 | + be filling the space, exactly<br> |
| 719 | + what font would be used, or<br> |
| 720 | + exactly which platform's font<br> |
| 721 | + rendering would be used to<br> |
| 722 | + display the font).</div> |
| 723 | + </table> |
| 724 | + </div> |
652 | 725 |
|
653 | 726 | <h2 id=conformance><span class=secno>4. </span> Conformance</h2> |
654 | 727 |
|
|
0 commit comments