Skip to content

Instantly share code, notes, and snippets.

@medunla
Created October 17, 2018 15:21
Show Gist options
  • Save medunla/475f912da13490d80abf64d47e26da28 to your computer and use it in GitHub Desktop.
Save medunla/475f912da13490d80abf64d47e26da28 to your computer and use it in GitHub Desktop.
Align with CSS Flexbox - Step 2
<!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>Flexbox</title>
<style>
.container {
width: 300px;
height: 300px;
background-color: #ccc;
display: flex;
align-items: center;
justify-content: center;
}
.child {
padding: 15px;
background-color: #5fe687;
}
.child-2 {
padding: 15px;
background-color: #5f73e6;
}
</style>
</head>
<body>
<div class="container">
<div class="child">I am child</div>
<div class="child-2">I am child-2<br>and I bigger</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment