I am attempting to transform the first letter in a text to uppercase and limit it to a maximum of 5 lines.
Check out this fiddle: https://jsfiddle.net/1crvt37n/
.capitalize-first-letter::first-letter {
text-transform: uppercase;
}
.line-clamp {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>;
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="capitalize-first-letter line-clamp" style="width: 100px">
This text should start with a capital letter and be limited to only 5 rows...
This text should start with a capital letter and be limited to only 5 rows...
This text should start with a capital letter and be limited to only 5 rows...
This text should start with a capital letter and be limited to only 5 rows...
This text should start with a capital letter and be limited to only 5 rows...
This text should start with a capital letter and be limited to only 5 rows...
</div>
</body>
</html>
In my Firefox browser (Mac, Version: 110.0) it behaves as intended, but in Chrome (110.0.5481.177) it does not. The first letter remains lowercase in Chrome, while the line clamp functions correctly in both browsers.
Is there a way to make it function properly in Chrome?