| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>069 inline-flex tail</title>
- <style>
- body { background: #ffffff; color: #202020; font-family: sans-serif;
- margin: 12px; font-size: 18px; }
- p { width: 600px; line-height: 24px; margin: 0 0 8px 0; }
- #a { background: #e0e0ff; }
- #b { background: #e0ffe0; }
- .more { display: inline-flex; align-items: center; font-weight: bold;
- color: #0050a0; }
- #result { background: #ffc8c8; color: #000000; padding: 8px;
- margin-top: 12px; }
- </style>
- </head>
- <body>
- <h1>069 — inline-flex tail</h1>
- <p>An <code>inline-flex</code> span with only text continues the line, like
- an inline-block (news teasers end their text with one).</p>
- <p id="a">Short teaser text. <span class="more">more</span></p>
- <p id="b">Short teaser text. <b style="color:#0050a0">more</b></p>
- <div id="result">checking...</div>
- <script>
- setTimeout(function () {
- function R(id) { return document.getElementById(id).getBoundingClientRect(); }
- var a = R('a'), b = R('b');
- var ok = Math.abs(a.height - b.height) <= 2 && a.height < 40;
- var r = document.getElementById('result');
- if (r) {
- r.style.background = ok ? '#c8f0c8' : '#ffc8c8';
- r.textContent = (ok ? 'INLFLEX-OK ' : 'INLFLEX-FAIL ') + 'a=' +
- Math.round(a.height) + ' b=' + Math.round(b.height);
- }
- }, 300);
- </script>
- </body>
- </html>
|