Single-line center, multi-row left, more than two lines with ellipses
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
Margin: 0;
Padding: 0;
}
H2 em {
Position: relative;
Font-style: normal;
Text-align: left;
Overflow: hidden;
Text-overflow: ellipsis;
Display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.container {
Width: 320px;
Padding: 0 10px;
Margin: 10px auto;
Background: #ddd;
}
.container p {
Display: inline-block;
Text-align: center;
}
H2 {
Text-align: center;
Padding: 10px 0;
}
</style>
</head>
<body>
<div class="container">
<h2>
<p>
<em>I am centered on a single line</em>
</p>
</h2>
<h2>
<p>
<em>I am two lines of headline, two lines of headlines, two lines of headings left</em>
</p>
</h2>
<h2>
<p>
<em>I am more than two lines of the title and the last point is omitted. I am more than two lines of the title. The last point is omitted. I am more than two lines of the title. The last point is omitted. Omitted omitted</em>
</p>
</h2>
</div>
</body>
</html>