| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>060 legacy -webkit-box</title>
- <style>
- body { background: #ffffff; color: #202020; font-family: sans-serif;
- margin: 12px; font-size: 18px; }
- #box { display: -webkit-box; -webkit-box-orient: vertical;
- -webkit-line-clamp: 2; width: 260px; overflow: hidden;
- background: #eeeeff; font-size: 24px; }
- #result { background: #ffc8c8; color: #000000; padding: 8px;
- margin-top: 12px; }
- </style>
- </head>
- <body>
- <h1>060 — legacy -webkit-box</h1>
- <p>The line-clamp idiom must render as a normal block so the text keeps its
- height and remains visible.</p>
- <div id="box"><span>alpha beta</span><span>gamma delta</span></div>
- <div id="result">checking...</div>
- <script>
- setTimeout(function () {
- var b = document.getElementById('box');
- var r = b.getBoundingClientRect();
- var d = getComputedStyle(b).display;
- var ok = d === 'block' && r.height > 10 && r.width > 200;
- var out = document.getElementById('result');
- if (out) {
- out.style.background = ok ? '#c8f0c8' : '#ffc8c8';
- out.textContent = (ok ? 'WEBKIT-BOX-OK ' : 'WEBKIT-BOX-FAIL ') +
- 'display=' + d + ' ' + Math.round(r.width) + 'x' +
- Math.round(r.height);
- }
- }, 300);
- </script>
- </body>
- </html>
|