flex-flex
by rootjang
HTML
<!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>
#container {
width: 500px;
height: 300px;
display: flex;
margin: 0 auto 20px;
align-items: center;
border: 2px solid black;
}
#container div {
width: 100px;
height: 50px;
border: 2px solid black;
background: #ccc;
}
#box1 {
-ms-flex: 1 1 0;
-webkit-flex: 1 1 0;
flex: 1 1 0;
}
#box2 {
-ms-flex: 2 2 0;
-webkit-flex: 2 2 0;
flex: 2 2 0;
}
h1 {
text-align:center;
}
p {
font-weight:bold;
text-align:center;
font-weight:bold;
}
</style>
</head>
<body>
<div id="container">
<div id="box1"><p>1</p></div>
<div id="box2"><p>2</p></div>
<div id="box3"><p>3</p></div>
</div>
</body>
</html>