Skip to content

Instantly share code, notes, and snippets.

@ghostdevv
Created December 1, 2020 19:11
Show Gist options
  • Save ghostdevv/070108208c1479be7b9e1bb9410025de to your computer and use it in GitHub Desktop.
Save ghostdevv/070108208c1479be7b9e1bb9410025de to your computer and use it in GitHub Desktop.
Flexbox corners (Some positioning with absolute)
*, *::before, *::after { box-sizing: border-box; }
.flexbox-corners {
background-color: DarkCyan;
width: 100%;
height: 100%;
display: flex;
justify-content:space-between;
position: relative;
}
.flexbox-corners > div {
width: 50px;
height: 50px;
background-color: DarkGray;
display: grid;
place-items: center;
}
.flexbox-corners > div:nth-child(2) {
align-self: flex-end;
position: absolute;
bottom: 0;
left: 0;
}
.flexbox-corners > div:nth-child(3) {
align-self: flex-end;
position: absolute;
bottom: 0;
right: 0;
}
<div class="flexbox-corners">
<div>
<p>1</p>
</div>
<div>
<p>2</p>
</div>
<div>
<p>3</p>
</div>
<div>
<p>4</p>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment