Skip to content

Instantly share code, notes, and snippets.

@randompast
Created March 23, 2015 16:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randompast/e3d2fc4319a35858918f to your computer and use it in GitHub Desktop.
Save randompast/e3d2fc4319a35858918f to your computer and use it in GitHub Desktop.
resize with flexbox - much easier than people seem to think!
<html>
<head>
<title>Resize Demo</title>
<style media="screen">
body {
margin:0;
padding:0;
}
.container {
display: flex;
height: 100%;
}
.infoBar {
/*flex: 1; prevents resize!*/
min-width:200px;
background-color: #cfc;
border-style: solid;
border-width: 1px;
resize: horizontal;
overflow: auto;
}
#canvas {
min-width:200px;
flex:3;
background-color: #cfe;
border-style: solid;
border-width: 1px;
}
</style>
</head>
<body>
<div class="container">
<div class="infoBar">
<ul>
<li>Thing1</li>
<li>Thing2</li>
<li>Thing3</li>
</ul>
</div>
<canvas id="canvas"></canvas>
</div>
</body>
</html>
@randompast
Copy link
Author

@Bluejanis
Copy link

Nice.
Sadly IE11 does not support it, and I have to support IE11.

@Mr-Saltman
Copy link

Thanks a lot! That helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment