xxxxxxxxxx
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
min-height: 100vh;
align-items: center;
}
div {
margin: auto;
border: 1px solid gray;
}
</style>
</head>
<body>
<div>Element is centered horizontaly.</div>
</body>
</html>