Created
November 6, 2019 19:28
-
-
Save L5eoneill/13a15b0095e6fcb98c6ae5eeda4b97de to your computer and use it in GitHub Desktop.
Flex: bottom footers in flexible cells
This file contains hidden or 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
<div class="row"> | |
<div class="col"> | |
<div class="text">Lorem ipsum.</div> | |
<div class="foot">foot</div> | |
</div> | |
<div class="col"> | |
<div class="text">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.</div> | |
<div class="foot"> | |
foot | |
</div> | |
</div> | |
<div class="col"> | |
<div class="text">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. Duis aute irure | |
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</div> | |
<div class="foot"> | |
foot | |
</div> | |
</div> | |
</div> | |
<p><a href="https://github.com/philipwalton/flexbugs/issues/196#issuecomment-386577760">🔗 github.com/philipwalton/flexbugs/issues/196#issuecomment-386577760</a> |
This file contains hidden or 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
.row { | |
border: 2px solid red; | |
display: flex; | |
flex-direction: row; | |
} | |
.col { | |
border: 2px solid green; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
flex-grow: 1; | |
flex-basis: 20rem; | |
flex-shrink: 0; | |
flex-wrap: wrap; | |
} | |
.text { | |
background-color: #ccc; | |
max-width: 100%; /* For IE11 */ | |
box-sizing: border-box; /* For IE11 */ | |
padding: 1rem; | |
} | |
.foot { | |
margin-top: auto; /* This pushes it at the bottom. */ | |
background-color: #eee; | |
border-top: 2px solid; | |
padding: 1rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment