Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
div {
border: 2px solid lightblue;
height: 100px;
padding: 10px 0;
display: flex;
justify-content: center;
}
</style>
</head>
<body>
<h1>Horizontally aligned element</h1>
<div>
A horizontally aligned text with the CSS justify-content property.
</div>
</body>
</html>