Last active
December 14, 2020 09:39
-
-
Save vctls/ad7fa52f725636ed8a24b4606e774a00 to your computer and use it in GitHub Desktop.
Bottom aligned divs, with the right one wrapping above the left one while sticking to bottom right.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<html lang="en"> | |
<style type="text/css"> | |
.container { | |
height: 300px; | |
background: darkgrey; | |
resize: both; | |
overflow: auto; | |
display: flex; | |
flex-wrap: wrap-reverse; /* Wraps from bottom right to top left. */ | |
justify-content: space-between; /* Keeps divs right and left alignment when NOT wrapping. */ | |
} | |
.bottomLeft { | |
background: orange; | |
height: 100px; | |
width: 500px; | |
} | |
.bottomRight { | |
background: purple; | |
height: 100px; | |
width: 500px; | |
margin-top: 100%; /* Keeps bottom alignment when wrapping. */ | |
margin-left: auto; /* Keeps right alignment when wrapping. */ | |
} | |
</style> | |
<body> | |
<div class="container"> | |
<div class="bottomLeft"></div> | |
<div class="bottomRight" style=""></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demo
Use bottom right handle to resize container.