Skip to content

Instantly share code, notes, and snippets.

@werenall
Created May 14, 2019 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save werenall/35156b98c6369b44b8b9b43467b4bd53 to your computer and use it in GitHub Desktop.
Save werenall/35156b98c6369b44b8b9b43467b4bd53 to your computer and use it in GitHub Desktop.
.canvas {
width: 600px;
display: flex;
}
.canvas__left {
display: flex;
flex: 1;
flex-shrink: 0;
}
.canvas__right {
display: flex;
flex: 1;
justify-content: flex-end;
}
.canvas__center {
//flex-shrink: 0;
}
/* The following styling is just for the purpose of making this example more legible. You can ignore it.*/
.canvas__left {
background: cyan;
border: solid 5px cyan;
}
.canvas__right {
background: cornsilk;
border: solid 5px cornsilk;
}
.canvas__center {
background: tomato;
border: solid 5px tomato;
}
<div class="canvas">
<div class="canvas__left">
<button>a</button>
<button>b</button>
<button>c</button>
</div>
<div class="canvas__center">
<div>I'll try my best to be in the centre</div>
</div>
<div class="canvas__right">
<button>1</button>
<button>2</button>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment