<html>
<head>
<style>
.center {
line-height: 200px;
height: 200px;
border: 3px solid green;
text-align: center;
}
.center p {
line-height: 1.5;
display: inline-block;
vertical-align: middle;
}
</style>
</head>
<body>
<h2>Centering</h2>
<p>In this example, we use the line-height property with a value that is equal to the height property to center the div element:</p>
<div class="center">
<p>I am vertically and horizontally centered.</p>
</div>
</body>
<!-- Mirrored from www.w3schools.com/css/tryit.asp?filename=trycss_align_line-height by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 31 Mar 2021 13:04:40 GMT -->
</html>