text-align-justify-002

text-align: justify, direction: ltr

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Assertion
text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the left.

Source

 1 <!DOCTYPE html>
 2 <html lang="en"><head>
 3 <meta charset="utf-8">
 4 <title>text-align: justify, direction: ltr</title>
 5 <link href="reference/text-align-justify-ref-002.htm" rel="match">
 6 <link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
 7 <link href="https://drafts.csswg.org/css-text-3/#text-align-property" rel="help">
 8 <meta content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the left." name="assert">
 9 <style type="text/css">
10 .test { text-align: justify; direction: ltr; }
11 /* the CSS below is not part of the test */
12 .test, .ref { border: 1px solid orange;  margin: 20px; width: 399px; color: orange; font: 24px/24px ahem; }
13 .ref { text-align: right; position: relative; height:72px;  }
14 .rb { position: absolute;  background-color: orange;  width: 72px; }
15 #rb1 { top: 0; right: 0; height: 48px;  }
16 #rb2 { top: 0; right: 109px; height: 48px; }
17 #rb3 { top: 0; right: 218px; height: 48px; }
18 #rb4 { top: 0; right: 327px; height: 72px; }
19 #rb5 { top: 48px; left: 96px; height: 24px; }
20 #rb6 { top: 48px; left: 192px; height: 24px; }
21 </style>
22 </head>
23 <body>
24 <div id="instructions">Test passes if the shading in both orange boxes is identical.</div>
25 <div style="direction: rtl;">
26 <div class="test">XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX </div>
27 <div class="ref"><div id="rb1" class="rb"></div><div id="rb2" class="rb"></div><div id="rb3" class="rb"></div><div id="rb4" class="rb"></div><div id="rb5" class="rb"></div><div id="rb6" class="rb"></div></div>
28 </div>
29 
30 </body></html>