<!DOCTYPE html>
<html>
<head>
<title>Заголовок документа</title>
<style>
#flex {
width: 300px;
height: 100px;
border: 1px solid #c3c3c3;
display: -webkit-flex; /* Safari */
-webkit-justify-content: center; /* Safari 6.1+ */
display: flex;
justify-content: center;
}
div {
width: 70px;
height: 70px;
}
</style>
</head>
<body>
<h2>Пример свойства display</h2>
<p>Использовано свойство "display: flex;":</p>
<div id="flex">
<div style="background-color: #1c87c9;">1</div>
<div style="background-color: #666;">2</div>
<div style="background-color: #8ebf42;">3</div>
</div>
</body>
</html>