Skip to content

Instantly share code, notes, and snippets.

@esnya
Last active March 28, 2016 14:58
Show Gist options
  • Select an option

  • Save esnya/033b1a575087dd8d017f to your computer and use it in GitHub Desktop.

Select an option

Save esnya/033b1a575087dd8d017f to your computer and use it in GitHub Desktop.
Responsive design (?) by CSS flex-box
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Flex Responsive</title>
<style>
html, body, .container {
margin: 0;
padding: 0;
width: 100%;
min-width: 216px;
}
.row {
display: flex;
flex-wrap: wrap;
width: 100%;
}
.col {
flex: 1 0 200px;
margin: 8px;
border: 1px solid #000;
background: #aaa;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col">A<br>A</div>
<div class="col">B</div>
<div class="col">C</div>
<div class="col" style="flex: 1 0 300px;">D<br>D</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment