line-clamp-019.html (809B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: line-clamp and -webkit-line-clamp compete in cascade order</title> 4 <link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp"> 6 <link rel="match" href="reference/webkit-line-clamp-005-ref.html"> 7 <meta name="assert" content="line-clamp and -webkit-line-clamp are both shorthands for the same properties, so if both are present, whichever is greater in the cascade order wins."> 8 <style> 9 .clamp { 10 line-clamp: 2; 11 display: -webkit-box; 12 -webkit-box-orient: vertical; 13 -webkit-line-clamp: 4; 14 font: 16px / 32px serif; 15 white-space: pre; 16 padding: 0 4px; 17 background-color: yellow; 18 } 19 </style> 20 <div class="clamp">Line 1 21 Line 2 22 Line 3 23 Line 4 24 Line 5</div>